Commit fdef14ba authored by Vincent Pelletier's avatar Vincent Pelletier

Do not rely on proc to know if a process is running.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2344 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 09830c78
...@@ -147,8 +147,16 @@ class NEOProcess(object): ...@@ -147,8 +147,16 @@ class NEOProcess(object):
self.arg_dict['--uuid'] = dump(uuid) self.arg_dict['--uuid'] = dump(uuid)
def isAlive(self): def isAlive(self):
return os.path.exists('/proc/%d' % self.pid) try:
os.kill(self.pid, 0)
except OSError, (errno, msg):
if errno == 3: # No such process
result = False
else:
raise
else:
result = True
return result
class NEOCluster(object): class NEOCluster(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment