-
-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Killing a process tree is a hard problem. In dinit, it is currently done via process groups:
Lines 438 to 453 in 712e1fa
| void base_process_service::kill_pg(int signo) noexcept | |
| { | |
| if (onstart_flags.signal_process_only) { | |
| bp_sys::kill(pid, signo); | |
| } | |
| else { | |
| pid_t pgid = bp_sys::getpgid(pid); | |
| if (pgid == -1) { | |
| // On some OSes (eg OpenBSD) we aren't allowed to get the pgid of a process in a different | |
| // session. If the process is in a different session, however, it must be a process group | |
| // leader and the pgid must equal the process id. | |
| pgid = pid; | |
| } | |
| bp_sys::kill(-pgid, signo); | |
| } | |
| } |
Linux 5.14 added cgroup.kill, which can be used to atomically SIGKILL entire cgroup: https://lwn.net/Articles/855049/
Could dinit also use it, if compiled with cgroup support enabled?
Metadata
Metadata
Assignees
Labels
No labels