p = manager_get_unit(UNIT(s)->meta.manager, k);
free(k);
+ if (!p)
+ continue;
+
if ((r = socket_collect_fds(SOCKET(p), &cfds, &cn_fds)) < 0)
goto fail;
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) {
/* 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: