diff --git a/src/core/service.c b/src/core/service.c index af5a2decf11..11b22c94467 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3538,6 +3538,9 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { } } else if (s->control_pid == pid) { + const char *kind; + bool success; + s->control_pid = 0; if (s->control_command) { @@ -3552,15 +3555,24 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { if (f == SERVICE_FAILURE_EXIT_CODE && status < 255) { UNIT(s)->condition_result = false; f = SERVICE_SKIP_CONDITION; - } else if (f == SERVICE_SUCCESS) + success = true; + } else if (f == SERVICE_SUCCESS) { UNIT(s)->condition_result = true; + success = true; + } else + success = false; + + kind = "Condition check process"; + } else { + kind = "Control process"; + success = f == SERVICE_SUCCESS; } unit_log_process_exit( u, - "Control process", + kind, service_exec_command_to_string(s->control_command_id), - f == SERVICE_SUCCESS, + success, code, status); if (s->state != SERVICE_RELOAD && s->result == SERVICE_SUCCESS) diff --git a/src/core/unit.c b/src/core/unit.c index 3792cee7112..be8e0ddef20 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5576,12 +5576,13 @@ void unit_log_process_exit( log_unit_struct(u, level, "MESSAGE_ID=" SD_MESSAGE_UNIT_PROCESS_EXIT_STR, - LOG_UNIT_MESSAGE(u, "%s exited, code=%s, status=%i/%s", + LOG_UNIT_MESSAGE(u, "%s exited, code=%s, status=%i/%s%s", kind, sigchld_code_to_string(code), status, strna(code == CLD_EXITED ? exit_status_to_string(status, EXIT_STATUS_FULL) - : signal_to_string(status))), + : signal_to_string(status)), + success ? " (success)" : ""), "EXIT_CODE=%s", sigchld_code_to_string(code), "EXIT_STATUS=%i", status, "COMMAND=%s", strna(command),