+ def start(self, name):
+ log.debug(u'ProcessManager.start(%s)', name)
+ assert name not in self.namemap
+ self._call(self.services[name])
+
+ def stop(self, name):
+ log.debug(u'ProcessManager.stop(%s)', name)
+ assert name in self.namemap
+ self.namemap[name].stop()
+
+ def restart(self, name):
+ log.debug(u'ProcessManager.restart(%s)', name)
+ # we have to check first in namemap in case is an unregistered
+ # process (added with call())
+ if name in self.namemap:
+ pi = self.namemap[name]
+ pi.stop()
+ pi.process.wait()
+ pi.restart()
+ else:
+ self.services[name].start()
+
+ def kill(self, name, signum):
+ log.debug(u'ProcessManager.kill(%s, %s)', name, signum)
+ assert name in self.namemap
+ self.namemap[name].kill(name, stop)
+
+ def sigchild_handler(self, signum, stack_frame=None):
+ log.debug(u'ProcessManager.sigchild_handler(%s)', signum)