diff -Nru websockify-0.5.1+dfsg1/debian/changelog websockify-0.5.1+dfsg1/debian/changelog --- websockify-0.5.1+dfsg1/debian/changelog 2013-12-09 05:02:55.000000000 +0000 +++ websockify-0.5.1+dfsg1/debian/changelog 2014-08-15 07:06:12.000000000 +0000 @@ -1,8 +1,17 @@ -websockify (0.5.1+dfsg1-3~cloud0) precise-icehouse; urgency=low +websockify (0.5.1+dfsg1-3ubuntu0.14.04.1~cloud0) precise-icehouse; urgency=medium * New update for the Ubuntu Cloud Archive. - -- Openstack Ubuntu Testing Bot Mon, 09 Dec 2013 00:02:55 -0500 + -- Openstack Ubuntu Testing Bot Fri, 15 Aug 2014 03:06:12 -0400 + +websockify (0.5.1+dfsg1-3ubuntu0.14.04.1) trusty; urgency=medium + + * Fixup handling of child processes to avoid zombies (LP: #1350352): + - d/p/avoid-zombies.patch, + d/p/handle-multiprocessing.patch: Cherry picked fixes from upstream + VCS to handle signals to child processes correctly. + + -- James Page Thu, 31 Jul 2014 14:40:12 +0100 websockify (0.5.1+dfsg1-3) unstable; urgency=low diff -Nru websockify-0.5.1+dfsg1/debian/control websockify-0.5.1+dfsg1/debian/control --- websockify-0.5.1+dfsg1/debian/control 2013-12-08 06:27:05.000000000 +0000 +++ websockify-0.5.1+dfsg1/debian/control 2014-07-31 13:23:07.000000000 +0000 @@ -1,7 +1,8 @@ Source: websockify Section: python Priority: optional -Maintainer: PKG OpenStack +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: PKG OpenStack Uploaders: Loic Dachary (OuoU) , Julien Danjou , Thomas Goirand , diff -Nru websockify-0.5.1+dfsg1/debian/patches/avoid-zombies.patch websockify-0.5.1+dfsg1/debian/patches/avoid-zombies.patch --- websockify-0.5.1+dfsg1/debian/patches/avoid-zombies.patch 1970-01-01 00:00:00.000000000 +0000 +++ websockify-0.5.1+dfsg1/debian/patches/avoid-zombies.patch 2014-07-31 12:58:57.000000000 +0000 @@ -0,0 +1,31 @@ +From 354dd6b0a216cb7ee49f0ec39aa57fa7f96990f7 Mon Sep 17 00:00:00 2001 +From: directxman12 +Date: Fri, 20 Sep 2013 14:12:35 -0400 +Subject: [PATCH] Enable Process Reaping in All Conditions + +Process reaping via the SIGCHLD handler is now enabled in all +circumstances, instead of just when os.fork is being used. + +Fixes #95 +--- + websockify/websocket.py | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/websockify/websocket.py b/websockify/websocket.py +index d37fa71..4fe98b8 100644 +--- a/websockify/websocket.py ++++ b/websockify/websocket.py +@@ -754,9 +754,7 @@ def start_server(self): + + # Allow override of SIGINT + signal.signal(signal.SIGINT, self.do_SIGINT) +- if not multiprocessing: +- # os.fork() (python 2.4) child reaper +- signal.signal(signal.SIGCHLD, self.fallback_SIGCHLD) ++ signal.signal(signal.SIGCHLD, self.fallback_SIGCHLD) + + last_active_time = self.launch_time + while True: +-- +2.0.3 + diff -Nru websockify-0.5.1+dfsg1/debian/patches/handle-multiprocessing.patch websockify-0.5.1+dfsg1/debian/patches/handle-multiprocessing.patch --- websockify-0.5.1+dfsg1/debian/patches/handle-multiprocessing.patch 1970-01-01 00:00:00.000000000 +0000 +++ websockify-0.5.1+dfsg1/debian/patches/handle-multiprocessing.patch 2014-07-31 13:34:22.000000000 +0000 @@ -0,0 +1,42 @@ +From 53f1f1989ecf3d3086242831c74faa3801026f37 Mon Sep 17 00:00:00 2001 +From: Solly Ross +Date: Mon, 21 Oct 2013 16:50:52 -0400 +Subject: [PATCH] Handle SIGCHLD properly for multiprocessing + +This commit should fix #101 by enabling a special SIGCHLD +handler for when multiprocessing is in use. The handler +simply calls `multiprocessing.active_children()` (which in +turn calls `_cleanup()`) upon receiving a SIGCHLD. Now, +the `fallback_SIGCHLD` is only called when `multiprocessing` +is not in use. See also #95. +--- + websockify/websocket.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/websockify/websocket.py ++++ b/websockify/websocket.py +@@ -666,6 +666,9 @@ Sec-WebSocket-Accept: %s\r + #self.vmsg("Running poll()") + pass + ++ def multiprocessing_SIGCHLD(self, sig, stack): ++ self.vmsg('Reaping zombies, active child count is %s' % len(multiprocessing.active_children())) ++ + def fallback_SIGCHLD(self, sig, stack): + # Reap zombies when using os.fork() (python 2.4) + self.vmsg("Got SIGCHLD, reaping zombies") +@@ -754,7 +757,13 @@ Sec-WebSocket-Accept: %s\r + + # Allow override of SIGINT + signal.signal(signal.SIGINT, self.do_SIGINT) +- signal.signal(signal.SIGCHLD, self.fallback_SIGCHLD) ++ if not multiprocessing: ++ # os.fork() (python 2.4) child reaper ++ signal.signal(signal.SIGCHLD, self.fallback_SIGCHLD) ++ else: ++ # make sure that _cleanup is called when children die ++ # by calling active_children on SIGCHLD ++ signal.signal(signal.SIGCHLD, self.multiprocessing_SIGCHLD) + + last_active_time = self.launch_time + while True: diff -Nru websockify-0.5.1+dfsg1/debian/patches/series websockify-0.5.1+dfsg1/debian/patches/series --- websockify-0.5.1+dfsg1/debian/patches/series 2013-12-08 06:27:05.000000000 +0000 +++ websockify-0.5.1+dfsg1/debian/patches/series 2014-07-31 13:01:15.000000000 +0000 @@ -1,3 +1,5 @@ removes-websocket-swf-file.patch fix-rebind.so-not-found-when-installed.patch fixes-rebind-wrapper.patch +avoid-zombies.patch +handle-multiprocessing.patch