Check for selinux enforcing. Warn if it is.
This commit is contained in:
parent
67df99833a
commit
33a2ec8508
10
pungi
10
pungi
@ -19,6 +19,7 @@ import pypungi.pungi
|
|||||||
import yum
|
import yum
|
||||||
import pykickstart.parser
|
import pykickstart.parser
|
||||||
import pykickstart.version
|
import pykickstart.version
|
||||||
|
import subprocess
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
@ -31,6 +32,15 @@ def main():
|
|||||||
print >> sys.stderr, "You must run pungi as root"
|
print >> sys.stderr, "You must run pungi as root"
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
if opts.do_all or opts.do_buildinstall:
|
||||||
|
try:
|
||||||
|
selinux = subprocess.Popen('/usr/sbin/getenforce', stdout=subprocess.PIPE).communicate()[0].strip('\n')
|
||||||
|
if selinux == 'Enforcing':
|
||||||
|
print >> sys.stdout, "WARNING: SELinux is enforcing. This may lead to a compose with selinux disabled."
|
||||||
|
print >> sys.stdout, "Consider running with setenforce 0."
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# Set up the kickstart parser and pass in the kickstart file we were handed
|
# Set up the kickstart parser and pass in the kickstart file we were handed
|
||||||
ksparser = pykickstart.parser.KickstartParser(pykickstart.version.makeVersion())
|
ksparser = pykickstart.parser.KickstartParser(pykickstart.version.makeVersion())
|
||||||
ksparser.readKickstart(opts.config)
|
ksparser.readKickstart(opts.config)
|
||||||
|
Loading…
Reference in New Issue
Block a user