]> git.llucax.com Git - software/pymin.git/blobdiff - pymin/procman.py
Bugfix: call ProcessInfo.stop() in the right way (without parameters).
[software/pymin.git] / pymin / procman.py
index ab6953a084a885ce9c05c355e553ac997eb63b0c..0330e23542886dc0880e351f0538b01d88b4fe0a 100644 (file)
@@ -26,7 +26,6 @@ class ProcessInfo:
         self.signal = None
         self.process = None
         self.error_count = 0
-        self.last_return = None
         self.running = False
     def start(self):
         assert self.process is None
@@ -46,7 +45,7 @@ class ProcessInfo:
             self.kill(signal.SIGTERM)
     def kill(self, signum):
         assert self.process is not None
-        os.kill(pi.process.pid, signum)
+        os.kill(self.process.pid, signum)
         self.signal = signum
     def __repr__(self):
         pid = None
@@ -85,7 +84,7 @@ class ProcessManager:
 
     def stop(self, name):
         assert name in self.namemap
-        self.namemap[name].stop(name)
+        self.namemap[name].stop()
 
     def kill(self, name, signum):
         assert name in self.namemap
@@ -101,6 +100,7 @@ class ProcessManager:
         while pid:
             if pid in self.pidmap:
                 p = self.pidmap[pid]
+                p.process.returncode = status
                 if p.callback is not None:
                     p.callback(self, p)
                 if p.dont_run or not p.persist or p.error_count >= p.max_errors: