+
+ # execute initscripts
+ for cmd in self.INITSCRIPTS:
+ try:
+ # enter vserver context
+ arg_subst = { 'runlevel': runlevel }
+ cmd_args = [cmd[0]] + map(lambda x: x % arg_subst, cmd[1:])
+ cmd_file = "/vservers/" + self.name + cmd[0]
+ self.log(cmd_file)
+ if os.path.isfile(cmd_file):
+ self.log("executing '%s'" % " ".join(cmd_args))
+ self.chroot_call(subprocess.call, " ".join(cmd_args), shell=True)
+ else:
+ self.log("WARNING: could not run %s on %s" % (cmd[0], self.name))
+ except:
+ self.log(traceback.format_exc())
+