4 ms·
Practically speaking, things almost never go wrong when you kill -9 a process, as opposed to a more clean way. Also, time is money.
by a3voices 13y ago
Practically speaking, things almost never go wrong when you kill -9 a process, as opposed to a more clean way. Also, time is money.
- crimsonalucard 13y agoYou must never use multiprocessing. If you're application spawns children processes, kill -9 will leave all the children orphaned. It is better for the parent to catch a TERM and relay that signal to all the children. I find this to be a practical and typical use case...
- zAy0LfpBZLC8mAC 13y agoIf your application's child processes are orhpaned when the parent dies unexpectedly (for more than a few milliseconds), that is a bug in your program.
- bnegreve 13y agoNot necessarily, processes spawned by bash don't necessarily have to die if you kill bash. For example if you use disown/nohup .. etc.
- zAy0LfpBZLC8mAC 13y agoThat's not what is normally meant by "multiprocessing" - multiprocessing is when your application forks multiple processes of itself in order to get some concurrency/parallelism, and those forked processes should monitor their parent and exit immediately when the parent disappears.
- bnegreve 13y agoTrue, but that's still a good reason to avoid SIGKILLing your processes.