summaryrefslogtreecommitdiffstats
path: root/pysystemmgr
diff options
context:
space:
mode:
authorYi Li <adamliyi@msn.com>2016-08-18 17:08:13 +0800
committerPatrick Williams <patrick@stwcx.xyz>2016-08-22 16:24:10 +0000
commit03a8b1cfeac017a688c6ad4ffb237f40963db570 (patch)
treeec3c3aac7e419465c8c366ef9c61709dc7b90fa1 /pysystemmgr
parentc14f6fec3dd69511f36f6461e6795d5a84a9801e (diff)
downloadtalos-skeleton-03a8b1cfeac017a688c6ad4ffb237f40963db570.tar.gz
talos-skeleton-03a8b1cfeac017a688c6ad4ffb237f40963db570.zip
pysystemmgr: Handling SIGCHLD signal
SystemManager starts multiple child processes when system state changes. Set parent process to ignore the SIGCHLD signal, to prevent child processes transforming into zombies when they terminate. Resolves openbmc/openbmc#206 Change-Id: Ic8baa0cbb97f2df8fcc462a732a4194e4a6d3f8c Signed-off-by: Yi Li <adamliyi@msn.com>
Diffstat (limited to 'pysystemmgr')
-rw-r--r--pysystemmgr/system_manager.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pysystemmgr/system_manager.py b/pysystemmgr/system_manager.py
index 819b4c0..b02be02 100644
--- a/pysystemmgr/system_manager.py
+++ b/pysystemmgr/system_manager.py
@@ -1,6 +1,7 @@
#!/usr/bin/python -u
import sys
+import signal
import subprocess
import gobject
import dbus
@@ -194,6 +195,8 @@ class SystemManager(DbusProperties, DbusObjectManager):
if __name__ == '__main__':
+ # Ignore SIGCHLD signal, to prevent child process becoming zombie
+ signal.signal(signal.SIGCHLD, signal.SIG_IGN)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = get_dbus()
obj = SystemManager(bus, OBJ_NAME)
OpenPOWER on IntegriCloud