Re: shutdown and halt (204 Views)
Reply
Super Advisor
'chris'
Posts: 1,698
Registered: ‎05-10-2003
Message 1 of 3 (204 Views)
Accepted Solution

shutdown and halt

Hi

What are differences between shutdown and halt command on linux?
Please use plain text.
Frequent Advisor
Reiner  Rottmann
Posts: 44
Registered: ‎03-10-2011
Message 2 of 3 (204 Views)

Re: shutdown and halt

On a typically system this makes no difference.
See man 8 halt:

"If halt or reboot is called when the system is not in runlevel 0 or 6, in other words when it's running normally, shutdown will be invoked instead (with
the -h or -r flag). For more info see the shutdown(8) manpage."

shutdown tries to halt the system gracefully. Meaning it gives all running applications time to settle and stop themselves.

init 0

halt executes a sync to write changes to disk and stops the system.

As lots of users were confused about the different commands (halt, shutdown, restart, etc), some logic was put into these so that shutdown gets called where appropriate.
Please use plain text.
Honored Contributor
dirk dierickx
Posts: 958
Registered: ‎12-20-1999
Message 3 of 3 (204 Views)

Re: shutdown and halt

linux improving unix here once again, but if you work on other unix systems besides linux, i suggest you keep using the shutdown command.

the halt command on unix isn't that friendly and doesn't run shutdown first...
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation