1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

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.
This commit is contained in:
Lennart Poettering 2018-01-12 13:05:07 +01:00
parent 2ca9d97943
commit 5cdabc8d7b

View File

@ -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