this post was submitted on 02 Feb 2024
3 points (100.0% liked)

Programmer Humor

35334 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

edit: fixed thumbnail

you are viewing a single comment's thread
view the rest of the comments
[–] rwhitisissle@lemmy.ml 1 points 2 years ago

Depends on whether or not you want to kill only the child processes of a parent process or if you want to kill the parent as well. To kill the parent and children, you can kill the entire process group, specifying the pgid in the kill command. To kill only the parent you can trap SIGTERM in the parent and then send SIGTERM to the process group.