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:
eac36c0
)
Change spawn from NOWAIT to WAIT so NM exits after running initscripts even if script...
author
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Thu, 30 Aug 2007 20:23:16 +0000
(20:23 +0000)
committer
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Thu, 30 Aug 2007 20:23:16 +0000
(20:23 +0000)
python/vserver.py
patch
|
blob
|
history
diff --git
a/python/vserver.py
b/python/vserver.py
index
247d66f
..
617608a
100644
(file)
--- a/
python/vserver.py
+++ b/
python/vserver.py
@@
-190,7
+190,6
@@
class VServer:
os.chdir("/")
def chroot_call(self, fn, *args):
os.chdir("/")
def chroot_call(self, fn, *args):
-
cwd_fd = os.open(".", os.O_RDONLY)
try:
root_fd = os.open("/", os.O_RDONLY)
cwd_fd = os.open(".", os.O_RDONLY)
try:
root_fd = os.open("/", os.O_RDONLY)
@@
-296,7
+295,6
@@
class VServer:
return result
def open(self, filename, mode = "r", bufsize = -1):
return result
def open(self, filename, mode = "r", bufsize = -1):
-
return self.chroot_call(open, filename, mode, bufsize)
def __do_chcontext(self, state_file):
return self.chroot_call(open, filename, mode, bufsize)
def __do_chcontext(self, state_file):
@@
-352,7
+350,6
@@
class VServer:
raise ex
def enter(self):
raise ex
def enter(self):
-
state_file = open("/var/run/vservers/%s.ctx" % self.name, "w")
self.__do_chroot()
self.__do_chcontext(state_file)
state_file = open("/var/run/vservers/%s.ctx" % self.name, "w")
self.__do_chroot()
self.__do_chcontext(state_file)
@@
-396,7
+393,7
@@
class VServer:
cmd_args = [cmd[0]] + map(lambda x: x % arg_subst,
cmd[1:])
print >>log, "executing '%s'" % " ".join(cmd_args)
cmd_args = [cmd[0]] + map(lambda x: x % arg_subst,
cmd[1:])
print >>log, "executing '%s'" % " ".join(cmd_args)
- os.spawnvp(os.P_WAIT,cmd[0],cmd_args)
+ os.spawnvp(os.P_
NO
WAIT,cmd[0],cmd_args)
except:
traceback.print_exc()
os._exit(1)
except:
traceback.print_exc()
os._exit(1)
@@
-423,9
+420,7
@@
class VServer:
self.__update_config_file(self.config_file, resources)
def init_disk_info(self):
self.__update_config_file(self.config_file, resources)
def init_disk_info(self):
-
(self.disk_inodes, self.disk_blocks, size) = vduimpl.vdu(self.dir)
(self.disk_inodes, self.disk_blocks, size) = vduimpl.vdu(self.dir)
-
return size
def stop(self, signal = signal.SIGKILL):
return size
def stop(self, signal = signal.SIGKILL):
@@
-434,7
+429,6
@@
class VServer:
self.rlimits_changed = False
self.rlimits_changed = False
-
def create(vm_name, static = False, ctor = VServer):
options = []
def create(vm_name, static = False, ctor = VServer):
options = []