Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to cleanly shut down when things go wrong' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to cleanly shut down when things go wrong
Authored by: audiluv on Sep 10, '04 01:01:18PM

The reboot command tells the kernel to sync the file system and go back to the bootstrap process. This is not a clean shutdown. Anything that has open files or caches that have not properly been written or flushed stands a chance of corruption.

A clean shutdown can be invoked with the shutdown command. This goes through the inittab and shuts down services properly. However, shutdown does not alway work if there are hung processes or zombied threads. Killing the process with the kill (kill -9 pid) command usually works on hung processes. If not sometimes kill -HUP pid will make the process behave (long enough to kill it) or exit.

If all else fails using the reboot command is better than hitting the power or reset button. The power and reset button not only can cause file system corruption but can damage hardware.


---
"If you insist on getting credit for the work you do, you'll never get far in life. Don't confuse yourself with the idea of getting credit" - Colonel John Richa



[ Reply to This | # ]
kill -9 overkill
Authored by: sjk on Sep 10, '04 04:47:04PM
Killing the process with the kill (kill -9 pid) command usually works on hung processes. If not sometimes kill -HUP pid will make the process behave (long enough to kill it) or exit.

kill -KILL (aka "-9") is best saved as the last resort when other signals have failed to kill a process. And kill -HUP won't kill a process that kill -KILL didn't, at least not on any Unix-based systems I've used.

kill -9 is often misunderstood and misused, as explained in places like:

kill -9
Useless use of kill -9

And MacOSXHints could consider publishing this as a separate hint to help slow the propagation of disinformation in the OS X community. :-)

[ Reply to This | # ]