Fix tmux cgroup not stopping bash and hanging the shutdown

pull/3958/head
Eduardo Grajeda 2024-04-26 23:46:52 +02:00
parent 0a8571b6fe
commit 50c4a14e57
1 changed files with 11 additions and 0 deletions

View File

@ -144,6 +144,17 @@ systemd_move_pid_to_new_cgroup(pid_t pid, char **cause)
goto finish;
}
/*
* 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.