From: Lennart Poettering Date: Wed, 27 Jan 2010 04:32:31 +0000 (+0100) Subject: properly recognize successfull scripts X-Git-Tag: 0.git+20100605+dfd8ee-1~397 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd982a8baeabbaf4a09a382a64acc243ef7104c5;p=systemd properly recognize successfull scripts --- diff --git a/service.c b/service.c index cef94175..ae7fc36a 100644 --- a/service.c +++ b/service.c @@ -739,7 +739,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { assert(s); assert(pid >= 0); - success = code == CLD_EXITED || status == 0; + success = code == CLD_EXITED && status == 0; s->failure = s->failure || !success; if (s->main_pid == pid) { @@ -806,6 +806,8 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { /* No further commands for this step, so let's * figure out what to do next */ + log_debug("%s got final SIGCHLD for state %s", unit_id(u), state_string_table[s->state]); + switch (s->state) { case SERVICE_START_PRE: diff --git a/socket.c b/socket.c index cbddcaa7..fb622a66 100644 --- a/socket.c +++ b/socket.c @@ -626,7 +626,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) { assert(s); assert(pid >= 0); - success = code == CLD_EXITED || status == 0; + success = code == CLD_EXITED && status == 0; s->failure = s->failure || !success; assert(s->control_pid == pid); @@ -645,7 +645,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) { /* No further commands for this step, so let's figure * out what to do next */ - log_debug("%s finished with state %s", unit_id(u), state_string_table[s->state]); + log_debug("%s got final SIGCHLD for state %s", unit_id(u), state_string_table[s->state]); switch (s->state) {