1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

service: only fail notify services on empty cgroup during start

We stay in the SERVICE_START while no READY=1 notification message has
been received. When we are in the SERVICE_START_POST state, we have
already received a ready notification. Hence we should not fail when the
cgroup becomes empty in that state.
This commit is contained in:
Jouke Witteveen 2016-11-24 21:05:47 +01:00
parent 920ec31b5f
commit 71e529fcf1

View File

@ -2579,11 +2579,16 @@ static void service_notify_cgroup_empty_event(Unit *u) {
* SIGCHLD for. */
case SERVICE_START:
case SERVICE_START_POST:
if (s->type == SERVICE_NOTIFY)
if (s->type == SERVICE_NOTIFY) {
/* No chance of getting a ready notification anymore */
service_enter_signal(s, SERVICE_FINAL_SIGTERM, SERVICE_FAILURE_PROTOCOL);
else if (s->pid_file_pathspec) {
break;
}
/* Fall through */
case SERVICE_START_POST:
if (s->pid_file_pathspec) {
/* Give up hoping for the daemon to write its PID file */
log_unit_warning(u, "Daemon never wrote its PID file. Failing.");