summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2024-04-30 12:38:58 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2024-04-30 12:38:58 +0100
commit3823fa2c577d440649a84af660e4d3b0c095d248 (patch)
tree5963976d37d5e3025e45b6b14ceb452fe32aa1c9
parent0a8571b6fe4fdd4e741605f1f2b44344bd8edeb8 (diff)
Send SIGHUP since some programs ignore SIGTERM, from Eduardo Grajeda in GitHubHEADmaster
issue 3958.
-rw-r--r--compat/systemd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/compat/systemd.c b/compat/systemd.c
index 063474e3..bde372cc 100644
--- a/compat/systemd.c
+++ b/compat/systemd.c
@@ -145,6 +145,17 @@ systemd_move_pid_to_new_cgroup(pid_t pid, char **cause)
}
/*
+ * Make sure that the session shells are terminated with SIGHUP since
+ * bash and friends tend to ignore SIGTERM.
+ */
+ r = sd_bus_message_append(m, "(sv)", "SendSIGHUP", "b", 1);
+ if (r < 0) {
+ xasprintf(cause, "failed to append to properties: %s",
+ strerror(-r));
+ goto finish;
+ }
+
+ /*
* Inherit the slice from the parent process, or default to
* "app-tmux.slice" if that fails.
*/