summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsizanoen1 <msizanoen@qtmlabs.xyz>2023-02-07 20:17:21 +0700
committerLennart Poettering <lennart@poettering.net>2023-02-08 11:33:54 +0100
commit500cd2e83b8246fbf20d99db898039cfba746223 (patch)
treec525e3c6aba4f46f8205f3b20620a5ee62e55742
parentef9962212aab39e621c8ec465cf7909cbba6ba4d (diff)
downloadsystemd-500cd2e83b8246fbf20d99db898039cfba746223.tar.gz
unit: always return 1 in log_kill
This ensures that cg_kill_items returns the correct value to let the manager know that a process was killed.
-rw-r--r--src/core/unit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 1662469012..499e9b40ed 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -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.",