From 634129cba23f0d6986fb9c3e443b57d9c9ede201 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 18 Nov 2007 15:12:07 -0300 Subject: [PATCH] Add ProcessManager.restart() method to block until the restart is done. --- pymin/procman.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.43.0