From 71e529fcf18c00e4dd51fb46f7f289dc5eb11fbd Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Thu, 24 Nov 2016 21:05:47 +0100 Subject: 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. --- src/core/service.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/service.c b/src/core/service.c index 180854b57c..39b3589e6b 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."); -- cgit v1.2.3-54-g00ecf