]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: don't skip sigchld handler for main and control pid for services (#3738)
authorLukáš Nykrýn <lnykryn@redhat.com>
Sat, 16 Jul 2016 19:04:13 +0000 (21:04 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 16 Jul 2016 19:04:13 +0000 (15:04 -0400)
During stop when service has one "regular" pid one main pid and one
control pid and the sighld for the regular one is processed first the
unit_tidy_watch_pids will skip the main and control pid and does not
remove them from u->pids(). But then we skip the sigchld event because we
already did one in the iteration and there are two pids in u->pids.

v2: Use general unit_main_pid() and unit_control_pid() instead of
reaching directly to service structure.

src/core/manager.c

index 902c2a0a27eb14191a235955ed74699bca89d277..c69b797430a0cd784e50c8f7d64330a975a98499 100644 (file)
@@ -1729,7 +1729,10 @@ static void invoke_sigchld_event(Manager *m, Unit *u, const siginfo_t *si) {
         unit_unwatch_pid(u, si->si_pid);
 
         if (UNIT_VTABLE(u)->sigchld_event) {
-                if (set_size(u->pids) <= 1 || iteration != u->sigchldgen) {
+                if (set_size(u->pids) <= 1 ||
+                    iteration != u->sigchldgen ||
+                    unit_main_pid(u) == si->si_pid ||
+                    unit_control_pid(u) == si->si_pid) {
                         UNIT_VTABLE(u)->sigchld_event(u, si->si_pid, si->si_code, si->si_status);
                         u->sigchldgen = iteration;
                 } else