From: Lennart Poettering Date: Fri, 12 Jan 2018 12:05:07 +0000 (+0100) Subject: service: don't send out dbus change notifications spuriously on SIGCHLD X-Git-Tag: v237~37^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5cdabc8d7bf9831f4b3815c82f4e5b1ee3f2960b;p=thirdparty%2Fsystemd.git service: don't send out dbus change notifications spuriously on SIGCHLD Let's send them out only if the main or control processe exited and we recorded a new exit status that is worth reporting. But if any other service process died this is nothing to report since we don't expose any properties about that anyway. --- diff --git a/src/core/service.c b/src/core/service.c index 969e9b4ffcf..445f3ff6046 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3015,6 +3015,7 @@ static void service_notify_cgroup_empty_event(Unit *u) { } static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { + bool notify_dbus = true; Service *s = SERVICE(u); ServiceResult f; @@ -3293,10 +3294,12 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { assert_not_reached("Uh, control process died at wrong time."); } } - } + } else /* Neither control nor main PID? If so, don't notify about anything */ + notify_dbus = false; /* Notify clients about changed exit status */ - unit_add_to_dbus_queue(u); + if (notify_dbus) + unit_add_to_dbus_queue(u); /* We got one SIGCHLD for the service, let's watch all * processes that are now running of the service, and watch