diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2016-05-10 02:03:29 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2016-05-10 02:15:36 +0200 |
commit | 93495ee52b237b1baf971fb835a409dd0d37e7dc (patch) | |
tree | 4175974c212658a5b3c6fd4ede6bb61c78f66bb1 | |
parent | 1058c16c5b19c0ec43c14e8f23c796c346411b68 (diff) | |
download | bot-93495ee52b237b1baf971fb835a409dd0d37e7dc.tar.gz bot-93495ee52b237b1baf971fb835a409dd0d37e7dc.tar.bz2 bot-93495ee52b237b1baf971fb835a409dd0d37e7dc.zip |
Watcher: Clean signal handlers after fork
Fork does not reset the signal handlers to the default values, so if the
child process receives a SIGTERM the method of the parent process is called
and causes very strange behaviour.
-rwxr-xr-x | __init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/__init__.py b/__init__.py index d3f6b06..b3ea420 100755 --- a/__init__.py +++ b/__init__.py @@ -25,6 +25,7 @@ class Watcher(object): if child != 0: self._children.append(child) else: + signal.signal(signal.SIGTERM, signal.SIG_DFL) run_phenny(config) def run(self): |