Add selinux check to lorax-composer

anaconda needs to have SELinux set to disabled or permissive in order to
run correctly. Check at startup and exit with an error.
This commit is contained in:
Brian C. Lane 2018-05-03 16:49:34 -07:00
parent 5c25f98db7
commit 5e0246d4a9

View File

@ -28,6 +28,7 @@ import argparse
import grp
import os
import pwd
import selinux
import sys
import subprocess
from threading import Lock
@ -178,6 +179,9 @@ if __name__ == '__main__':
except KeyError:
errors.append("Missing group '%s'" % opts.group)
if selinux.is_selinux_enabled() and selinux.security_getenforce():
errors.append("selinux must be disabled or in Permissive mode.")
# No point in continuing if there are uid or gid errors
if errors:
for e in errors: