5 ms·
Killing everything on shutdown doesn't seem like a good idea. Programs should be able to shut down cleanly.
by sp332 10y ago
Killing everything on shutdown doesn't seem like a good idea. Programs should be able to shut down cleanly.
- astrange 10y agoYour data isn't safe unless every program can handle being randomly killed. The power can always go out. Now, once all your programs can be immediately killed, why would you ever not want to do that?
- sp332 10y agoIsn't it better to neatly close up remote connections instead of leaving them hanging to time out? I'm thinking of web servers and database clients.
- astrange 10y agoThe kernel should close all your TCP connections properly when you die, so it should all be good. Mostly you need to autosave files every so often.
- loeg 10y agoBasically, because a lot of data isn't safe and only manages to seem safe on average because the power is very reliable and data loss becomes an occasional race condition. :-)
- groovy2shoes 10y agoThey're sent SIGTERM via kill(1), then a short sleep, then any stragglers get SIGKILL. The idea is to clean up any non-responsive processes, or programs that intentionally ignore SIGTERM. Note that kill(1) just sends an arbitrary signal to whatever process(es), it doesn't have to be SIGKILL.
- sp332 10y agoYeah I know how the old init systems work. I also know that the newer ones all try to keep track of which services they're starting so they can shut them down in the right order and wait until they're finished.