From a911bb9ab27ac0eb3bbf4e8b4109e5da9b88eee3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 6 Feb 2014 17:17:51 +0100 Subject: core: watch SIGCHLD more closely to track processes of units with no reliable cgroup empty notifier When a process dies that we can associate with a specific unit, start watching all other processes of that unit, so that we can associate those processes with the unit too. Also, for service units start doing this as soon as we get the first SIGCHLD for either control or main process, so that we can follow the processes of the service from one to the other, as long as process that remain are processes of the ones we watched that died and got reassigned to us as parent. Similar, for scope units start doing this as soon as the scope controller abandons the unit, and thus management entirely reverts to systemd. To abandon a unit introduce a new Abandon() scope unit method call. --- src/core/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/manager.c') diff --git a/src/core/manager.c b/src/core/manager.c index 45f5f70b2..c0bcc79f0 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1459,7 +1459,7 @@ static int manager_dispatch_sigchld(Manager *m) { log_debug_unit(u->id, "Child %lu belongs to %s", (long unsigned) si.si_pid, u->id); - hashmap_remove(m->watch_pids, LONG_TO_PTR(si.si_pid)); + unit_unwatch_pid(u, si.si_pid); UNIT_VTABLE(u)->sigchld_event(u, si.si_pid, si.si_code, si.si_status); } -- cgit v1.2.3