]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: do not honor SuccessExitStatus= for our own helpers
authorMike Yuan <me@yhndnzj.com>
Sun, 14 Dec 2025 09:24:11 +0000 (10:24 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Dec 2025 19:04:02 +0000 (04:04 +0900)
They're exclusively under our control, hence errors should not be
suppressed based on external user input.

src/core/service.c

index 7098e2744a9369df45f70b918c98f8daed1b8443..99dd7bd0da3c814697a662ba140e902260a9e099 100644 (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;