]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
unit: always return 1 in log_kill
authormsizanoen1 <msizanoen@qtmlabs.xyz>
Tue, 7 Feb 2023 13:17:21 +0000 (20:17 +0700)
committerLennart Poettering <lennart@poettering.net>
Wed, 8 Feb 2023 10:33:54 +0000 (11:33 +0100)
This ensures that cg_kill_items returns the correct value to let the
manager know that a process was killed.

src/core/unit.c

index 166246901244365730298a0b858ecbf715c7aefc..499e9b40edac11e7d562e4e44adb9879e6bcaac7 100644 (file)
@@ -4500,7 +4500,9 @@ static int log_kill(pid_t pid, int sig, void *userdata) {
         /* Don't log about processes marked with brackets, under the assumption that these are temporary processes
            only, like for example systemd's own PAM stub process. */
         if (comm && comm[0] == '(')
-                return 0;
+                /* Although we didn't log anything, as this callback is used in unit_kill_context we must return 1
+                 * here to let the manager know that a process was killed. */
+                return 1;
 
         log_unit_notice(userdata,
                         "Killing process " PID_FMT " (%s) with signal SIG%s.",