From: Jouke Witteveen Date: Thu, 24 Nov 2016 20:05:47 +0000 (+0100) Subject: service: only fail notify services on empty cgroup during start X-Git-Tag: v233~375^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71e529fcf18c00e4dd51fb46f7f289dc5eb11fbd;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/service.c b/src/core/service.c index 180854b57cf..39b3589e6ba 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -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.");