From: Leandro Lucarella Date: Sun, 18 Nov 2007 18:12:07 +0000 (-0300) Subject: Add ProcessManager.restart() method to block until the restart is done. X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/634129cba23f0d6986fb9c3e443b57d9c9ede201?ds=inline;hp=-c Add ProcessManager.restart() method to block until the restart is done. --- 634129cba23f0d6986fb9c3e443b57d9c9ede201 diff --git a/pymin/procman.py b/pymin/procman.py index 12c269c..5cea4d4 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)