Check if /proc is mounted (#741722)

Needed for proper functionality in chroot,
so if it is not there, exit before doing anything.
This commit is contained in:
Martin Gracik 2011-10-03 12:17:17 +02:00
parent af6d4e2c50
commit 049d73874c

View File

@ -170,6 +170,13 @@ class Lorax(BaseLoraxClass):
logger.critical("no root privileges") logger.critical("no root privileges")
sys.exit(1) sys.exit(1)
# check if /proc is mounted
logger.info("checking /proc")
if (not os.path.isdir("/proc") and not os.path.exists("/proc/mounts")
and not os.path.exists("/proc/devices")):
logger.critical("missing required /proc files (not mounted?)")
sys.exit(1)
# do we have all lorax required commands? # do we have all lorax required commands?
self.lcmds = constants.LoraxRequiredCommands() self.lcmds = constants.LoraxRequiredCommands()