X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_vs.py;h=8ab08bcc77624aa5bc08e6bb9b32d6c35a6d8b29;hb=db6a282730892b350c31293976598a3abbdb026d;hp=376bf939414c72efda9b658971878d2c8fd2729c;hpb=f1c6c10681e05ee283340297167fd1b19f166d5c;p=nodemanager.git diff --git a/sliver_vs.py b/sliver_vs.py index 376bf93..8ab08bc 100644 --- a/sliver_vs.py +++ b/sliver_vs.py @@ -163,6 +163,8 @@ class Sliver_VS(accounts.Account, vserver.VServer): if self.rspec['enabled'] > 0: logger.log('%s: starting in %d seconds' % (self.name, delay)) time.sleep(delay) + # VServer.start calls fork() internally, + # so just close the nonstandard fds and fork once to avoid creating zombies child_pid = os.fork() if child_pid == 0: if self.initscriptchanged: @@ -174,14 +176,13 @@ class Sliver_VS(accounts.Account, vserver.VServer): os.close(fd) try: self.chroot_call(install_initscript) - self.initscriptchanged = False except: logger.log_exc(self.name) - # VServer.start calls fork() internally, - # so just close the nonstandard fds and fork once to avoid creating zombies tools.close_nonstandard_fds() vserver.VServer.start(self) os._exit(0) - else: os.waitpid(child_pid, 0) + else: + os.waitpid(child_pid, 0) + self.initscriptchanged = False else: logger.log('%s: not starting, is not enabled' % self.name) def stop(self):