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: adams4 on Sep 13, '04 09:11:02AM

The deal is this: when you use the shutdown command, you're executing certain scripts before the machine turns off (shutdown -h) or restarts (shutdown -r). When you execute reboot, you say, "please end all jobs if you can, kill what you can't, log this to the system log, write any cache back to disk, then restart cleanly." You can also use reboot -n to not flush the cache or reboot -q to reboot "quickly" (i.e., ungracefully). Thus executing reboot -nq is the equivalent of pressing the restart button.

If you just want to shutdown the machine, but you've got problematic jobs, then try using halt. This will terminate "good" jobs as above, kill "bad" jobs, flush cache, then power off (instead of restart as reboot does). Similar to reboot, you can halt -n, halt -q, or halt -nq to not flush cache, halt "quick," or just power off without doing anything (the equivalent of holding the power button to shut the machine off).

One more thing: these commands must all be executed using either sudo or by being root (you either logged in that way from the login screen or used su).

Adam Spector.

[ Reply to This | # ]