def wait(self):
if self.pid == None:
'Rule %s not initialized' % self.rulename
return
try:
pid, status = os.waitpid(self.pid, 0)
if pid != self.pid:
print("\nWARNING! Received status for unknown process {}".format(pid))
sys.exit(3)
if os.WIFEXITED(status):
rcode = os.WEXITSTATUS(status)
print("\n Rule session {0} terminated with return code: {1}.".format(pid,rcode))
except (RuntimeError, KeyboardInterrupt):
print("Killing worker processes...")
os.kill(self.pid, signal.SIGTERM)
pid, status = os.waitpid(self.pid, 0)
sys.exit(3)
评论列表
文章目录