From: Lennart Poettering Date: Fri, 4 Jun 2010 19:23:00 +0000 (+0200) Subject: service: handle properly if a dbus process terminates before acquiring the dbus name X-Git-Tag: 0.git+20100605+dfd8ee-1~9^2^2~5^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4653a4dfe059fa5ec84157ba2cd7ab2fd7c3faa;p=systemd service: handle properly if a dbus process terminates before acquiring the dbus name --- diff --git a/src/service.c b/src/service.c index c276a9a2..8b1fab78 100644 --- a/src/service.c +++ b/src/service.c @@ -1963,14 +1963,18 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; case SERVICE_START: - assert(s->type == SERVICE_FINISH); + if (s->type == SERVICE_FINISH) { + /* This was our main goal, so let's go on */ + if (success) + service_enter_start_post(s); + else + service_enter_signal(s, SERVICE_FINAL_SIGTERM, false); + break; + } else { + assert(s->type == SERVICE_DBUS); - /* This was our main goal, so let's go on */ - if (success) - service_enter_start_post(s); - else - service_enter_signal(s, SERVICE_FINAL_SIGTERM, false); - break; + /* Fall through */ + } case SERVICE_RUNNING: service_enter_running(s, success);