core/service: do not honor SuccessExitStatus= for our own helpers

They're exclusively under our control, hence errors should not be
suppressed based on external user input.
This commit is contained in:
Mike Yuan
2025-12-17 04:04:02 +09:00
committed by Yu Watanabe
parent c78d18096d
commit 552822992c
+2 -1
View File
@@ -4116,7 +4116,8 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
else
clean_mode = EXIT_CLEAN_DAEMON;
if (is_clean_exit(code, status, clean_mode, &s->success_status))
/* Our own helper processes are not subject to SuccessExitStatus= as they're opaque to users */
if (is_clean_exit(code, status, clean_mode, s->control_pid.pid == pid && s->control_command_id < 0 ? NULL : &s->success_status))
f = SERVICE_SUCCESS;
else if (code == CLD_EXITED)
f = SERVICE_FAILURE_EXIT_CODE;