git://git.onelab.eu
/
util-vserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c3b6928
)
vserver prep: set runlevel in /var/run/utmp, mount /proc and /dev/pts
author
Steve Muir
<smuir@cs.princeton.edu>
Wed, 15 Jun 2005 21:15:19 +0000
(21:15 +0000)
committer
Steve Muir
<smuir@cs.princeton.edu>
Wed, 15 Jun 2005 21:15:19 +0000
(21:15 +0000)
python/vserver.py
patch
|
blob
|
history
diff --git
a/python/vserver.py
b/python/vserver.py
index
cc568d2
..
39d15f2
100644
(file)
--- a/
python/vserver.py
+++ b/
python/vserver.py
@@
-8,9
+8,10
@@
import sys
import time
import traceback
import time
import traceback
-#import mount
+import mountimpl
import linuxcaps
import passfdimpl
import linuxcaps
import passfdimpl
+import utmp
import vserverimpl
from util_vserver_vars import *
import vserverimpl
from util_vserver_vars import *
@@
-164,12
+165,27
@@
class VServer:
garbage += filter(os.path.isfile, map((LOCKDIR + "/").__add__,
os.listdir(LOCKDIR)))
for f in garbage:
garbage += filter(os.path.isfile, map((LOCKDIR + "/").__add__,
os.listdir(LOCKDIR)))
for f in garbage:
- print >>log, "removing " + f
os.unlink(f)
# set the initial runlevel
os.unlink(f)
# set the initial runlevel
+ f = open(RUNDIR + "/utmp", "w")
+ utmp.set_runlevel(f, runlevel)
+ f.close()
# mount /proc and /dev/pts
# mount /proc and /dev/pts
+ self.__do_mount("none", "/proc", "proc")
+ # XXX - magic mount options
+ self.__do_mount("none", "/dev/pts", "devpts", 0, "gid=5,mode=0620")
+
+ def __do_mount(self, *mount_args):
+
+ try:
+ mountimpl.mount(*mount_args)
+ except OSError, ex:
+ if ex.errno == errno.EBUSY:
+ # assume already mounted
+ return
+ raise ex
def enter(self):
def enter(self):