# XXX - we don't support all scripts that vserver script does
self.__do_chcontext(state_file)
for cmd in self.INITSCRIPTS:
- try:
- # enter vserver context
- arg_subst = { 'runlevel': runlevel }
- cmd_args = [cmd[0]] + map(lambda x: x % arg_subst,
+ try:
+ # enter vserver context
+ arg_subst = { 'runlevel': runlevel }
+ cmd_args = [cmd[0]] + map(lambda x: x % arg_subst,
cmd[1:])
- print >>log, "executing '%s'" % " ".join(cmd_args)
- os.spawnvp(os.P_NOWAIT,cmd[0],cmd_args)
- except:
- print >>log, traceback.format_exc()
- os._exit(1)
+ if os.path.isfile(cmd[0]):
+ print >>log, "executing '%s'" % " ".join(cmd_args)
+ os.spawnvp(os.P_NOWAIT,cmd[0],cmd_args)
+ except:
+ print >>log, traceback.format_exc()
# we get here due to an exception in the top-level child process
except Exception, ex:
pass
def init_disk_info(self):
+ try:
+ dlimit = vserver.getdlimit(self.dir, self.ctx)
+ self.disk_blocks = dlimit[0]
+ self.disk_inodes = dlimit[2]
+ return self.disk_blocks * 1024
+ except Exception, e:
+ pass
cmd = "/usr/sbin/vdu --script --space --inodes --blocksize 1024 --xid %d %s" % (self.ctx, self.dir)
p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,