pid1: add ability to kill processes in a subgroup of a unit

This is useful for things like machined, where the system machined wants
to manage a machine owned by the user somewhere down the tree.
This commit is contained in:
Lennart Poettering
2025-07-08 03:14:53 +02:00
parent 9afe65d974
commit 0f23564ad4
11 changed files with 183 additions and 50 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ static int time_handler(sd_event_source *s, uint64_t usec, void *userdata) {
int r;
log_error("Test timeout when testing %s", unit->id);
r = unit_kill(unit, KILL_ALL, SIGKILL, SI_USER, 0, NULL);
r = unit_kill(unit, KILL_ALL, /* subgroup= */ NULL, SIGKILL, SI_USER, /* value= */ 0, /* ret_error= */ NULL);
if (r < 0)
log_error_errno(r, "Failed to kill %s, ignoring: %m", unit->id);