FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 10-03-2011, 10:20 AM
Martin Gracik
 
Default Check if /proc is mounted (#741722)

Needed for proper functionality in chroot,
so if it is not there, exit before doing anything.
---
src/pylorax/__init__.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index 8eb6c7f..85a7567 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -170,6 +170,13 @@ class Lorax(BaseLoraxClass):
logger.critical("no root privileges")
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?
self.lcmds = constants.LoraxRequiredCommands()

--
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org