Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • have you looked into kill options? Such as kill -9? Commented Aug 18, 2014 at 6:42
  • In my experience, shell scripts don't deal well with direct kills because shells don't automatically kill their child processes. If you want robust cleanups with shell scripts, you need to run them in separate process groups and you need to aim the kill at the whole group, not just the topmost process. I'm using a C program that ensures the script runs in a separate proces group and that all signals aimed at the topmost process are forwarded to the whole child group (I don't know how to handle signal forwarding corner cases in shell). Commented Jul 17, 2017 at 22:45