X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/75e67012c298ea163108ca79fc9deed1227fa8ff..8f0e9553bac4b3bbb14099c93639f6428fa402f9:/pymin/procman.py diff --git a/pymin/procman.py b/pymin/procman.py index 12c269c..4478cb7 100644 --- a/pymin/procman.py +++ b/pymin/procman.py @@ -86,6 +86,15 @@ class ProcessManager: assert name in self.namemap self.namemap[name].stop() + def restart(self, name): + logging.debug(u'ProcessManager.restart(%s)', name) + if name in self.namemap: + self.namemap[name].stop() + self.namemap[name].wait() + self.namemap[name].restart() + else: + self.namemap[name].start() + def kill(self, name, signum): assert name in self.namemap self.namemap[name].kill(name, stop) @@ -199,7 +208,7 @@ if __name__ == '__main__': while manager.pidmap: signal.pause() if sig == signal.SIGCHLD: - sig = None sigchild_handler(sig) + sig = None print "Esperando...", [pi.name for pi in manager.namemap.values()]