Timeline for When should I not kill -9 a process?
Current License: CC BY-SA 4.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 10, 2022 at 10:09 | comment | added | telcoM | "It should always be OK to do kill -9" is analogous to "an application should not do any internal write caching ever", which is... a bit simplistic. Database engines perform quite advanced write caching for performance, so you should not kill -9 a database engine or any other application that contains persistent state and has built-in write caching. Applications which rely on OS's write cache may be safe to kill -9; only applications which explicitly sync their state to disk at each appropriate point can be assured to be safe... but that will cost in performance. | |
| S Jan 10, 2022 at 9:20 | history | edited | AdminBee | CC BY-SA 4.0 | Formatting, typo, minor rephrasing |
| S Jan 10, 2022 at 9:20 | history | suggested | Good Pen | CC BY-SA 4.0 | improved formatting |
| Jan 8, 2022 at 5:38 | review | Suggested edits | |||
| S Jan 10, 2022 at 9:20 | |||||
| Aug 28, 2018 at 8:46 | comment | added | Mikko Rantalainen | I you only use "crash-only" software (lwn.net/Articles/191059) you can always send kill -9 safely. Unfortunately, most software ever written is not "crash-only". | |
| Jan 29, 2014 at 7:24 | comment | added | jlliagre | @gerryk They should indeed but the issue is some people will take that answer as a "license to kill -9" whatever the situation and the environment. It is an irresponsible attitude. | |
| Jan 28, 2014 at 22:58 | comment | added | gerryk | I suspect what Michael meant by 'OK' is that your program should deal with this situation gracefully, and be able to do some form of cleanup on restart. For instance, cleaning up PID files and so forth, rather than just throwing its toys out of the pram and refusing to start. | |
| Jan 28, 2014 at 20:44 | history | edited | Michael Mrozek | CC BY-SA 3.0 | deleted 5 characters in body |
| Jan 28, 2014 at 12:51 | comment | added | jlliagre | It is not OK to do a kill -9 just like it is not OK to pull the plug off. While of course there are situations where you have no choice, this should be a last resort action. Of course, pulling the power cable or kill -9 shouldn't have adverse effects like preventing the application or the OS to restart properly if at all, but shit happens and using the recommended ways (kill [-15]) or regular shutdown will help avoiding the mess that might occur if you routinely interrupt programs and OSes that way. In any case, there is always a risk to lose data regardless of the code robustness. | |
| Jan 28, 2014 at 8:09 | comment | added | Tadeusz A. Kadłubowski | @Karel: You test whether your system can recover afterwards, and clean up any mangled transactions that were being processed at the time of SIGKILL. | |
| Jan 28, 2014 at 7:28 | comment | added | Karel Bílek | How do you test for "random kill -9"? When you get kill -9, you are done and finished. | |
| Jan 28, 2014 at 6:32 | review | Low quality posts | |||
| Jan 28, 2014 at 6:51 | |||||
| S Jan 28, 2014 at 6:27 | review | Late answers | |||
| Jan 28, 2014 at 6:32 | |||||
| S Jan 28, 2014 at 6:27 | review | First posts | |||
| Jan 28, 2014 at 6:49 | |||||
| Jan 28, 2014 at 6:11 | history | answered | dbrower | CC BY-SA 3.0 |