Reap only activity processes. Fix #5044
This commit is contained in:
parent
6e1065454d
commit
6046c8ed46
@ -19,7 +19,6 @@ import sys
|
|||||||
import os
|
import os
|
||||||
from ConfigParser import ConfigParser
|
from ConfigParser import ConfigParser
|
||||||
import gettext
|
import gettext
|
||||||
import signal
|
|
||||||
|
|
||||||
import pygtk
|
import pygtk
|
||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
@ -86,12 +85,6 @@ def _shell_started_cb():
|
|||||||
hw_manager = hardwaremanager.get_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_dcon_freeze(0)
|
hw_manager.set_dcon_freeze(0)
|
||||||
|
|
||||||
def _sigchild_handler(signum, frame):
|
|
||||||
try:
|
|
||||||
os.wait()
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
gobject.idle_add(_shell_started_cb)
|
gobject.idle_add(_shell_started_cb)
|
||||||
|
|
||||||
@ -111,8 +104,6 @@ def main():
|
|||||||
win.show_all()
|
win.show_all()
|
||||||
gtk.main()
|
gtk.main()
|
||||||
|
|
||||||
signal.signal(signal.SIGCHLD, _sigchild_handler)
|
|
||||||
|
|
||||||
if os.environ.has_key("SUGAR_TP_DEBUG"):
|
if os.environ.has_key("SUGAR_TP_DEBUG"):
|
||||||
# Allow the user time to start up telepathy connection managers
|
# Allow the user time to start up telepathy connection managers
|
||||||
# using the Sugar DBus bus address
|
# using the Sugar DBus bus address
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import signal
|
||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
import gobject
|
import gobject
|
||||||
@ -53,6 +54,16 @@ _RAINBOW_SERVICE_NAME = "org.laptop.security.Rainbow"
|
|||||||
_RAINBOW_ACTIVITY_FACTORY_PATH = "/"
|
_RAINBOW_ACTIVITY_FACTORY_PATH = "/"
|
||||||
_RAINBOW_ACTIVITY_FACTORY_INTERFACE = "org.laptop.security.Rainbow"
|
_RAINBOW_ACTIVITY_FACTORY_INTERFACE = "org.laptop.security.Rainbow"
|
||||||
|
|
||||||
|
_children_pid = []
|
||||||
|
|
||||||
|
def _sigchild_handler(signum, frame):
|
||||||
|
for child_pid in _children_pid:
|
||||||
|
pid, status = os.waitpid(child_pid, os.WNOHANG)
|
||||||
|
if pid > 0:
|
||||||
|
_children_pid.remove(pid)
|
||||||
|
|
||||||
|
signal.signal(signal.SIGCHLD, _sigchild_handler)
|
||||||
|
|
||||||
def create_activity_id():
|
def create_activity_id():
|
||||||
"""Generate a new, unique ID for this activity"""
|
"""Generate a new, unique ID for this activity"""
|
||||||
pservice = presenceservice.get_instance()
|
pservice = presenceservice.get_instance()
|
||||||
@ -224,8 +235,9 @@ class ActivityCreationHandler(gobject.GObject):
|
|||||||
self._handle.uri)
|
self._handle.uri)
|
||||||
|
|
||||||
if not self._use_rainbow:
|
if not self._use_rainbow:
|
||||||
process = subprocess.Popen(command, env=environ, cwd=activity.path,
|
p = subprocess.Popen(command, env=environ, cwd=activity.path,
|
||||||
stdout=log_file, stderr=log_file)
|
stdout=log_file, stderr=log_file)
|
||||||
|
_children_pid.append(p.pid)
|
||||||
else:
|
else:
|
||||||
log_file.close()
|
log_file.close()
|
||||||
system_bus = dbus.SystemBus()
|
system_bus = dbus.SystemBus()
|
||||||
|
Loading…
Reference in New Issue
Block a user