Skip to content

Commit

Permalink
Merge pull request #226 abhishekkekane/bug/138
Browse files Browse the repository at this point in the history
Make websockify respond to SIGTERM
  • Loading branch information
DirectXMan12 committed Feb 18, 2016
2 parents 0b906a1 + 68b1587 commit 4e6938e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions websockify/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,14 @@ def start_server(self):

except (self.Terminate, SystemExit, KeyboardInterrupt):
self.msg("In exit")
# terminate all child processes
if multiprocessing and not self.run_once:
children = multiprocessing.active_children()

for child in children:
self.msg("Terminating child %s" % child.pid)
child.terminate()

break
except Exception:
exc = sys.exc_info()[1]
Expand Down

0 comments on commit 4e6938e

Please sign in to comment.