[SOLVED] Why does 'halt' require '-p' to turn off the computer?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why does 'halt' require '-p' to turn off the computer?
This is more of a curiosity question than an actual problem.
If you run
Code:
halt
the OS shuts down, but the computer's power stays on, and to turn it off you have to press and hold the power button. I don't see why this is useful. Maybe someone has a different view on it?
The system shuts down and the machine powers off. In fact, I have never used the -P option. If the command you are using is simply halt, perhaps it puts the systems into hibernation? I do not know, just guessing.
you can find a lot of threads on the net about it, like these: http://www.computerhope.com/unix/uhalt.htm and http://serverfault.com/questions/191...r-off-and-halt.
The most important difference is that halt will not send ACPI commands to the power supply. Long time ago those power supplies could not be set to off by ACPI, just by hand. Nowadays you are allowed to stop your box this way or automatically switch power off too.
So you can say, historical reason...
as far as I know you should first sync (twice), before halt. You cannot do anything if system was halted. That continue does not exist (or it is called warm boot probably).
On the computers I've used, 'halt' runs the computer through its normal shutdown routine (at least, I see all the same messages on the screen) and when it's done it sits there. I can't type 'sync' or 'continue' because the cursor is frozen.
After I posted this thread, I started to think about it, and my thoughts were like what pan64 said, that omitting the '-p' doesn't send the 'power off' command to the PSU.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.