LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-03-2014, 10:20 PM   #1
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
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?
 
Old 06-04-2014, 12:22 AM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
When I shut down from a terminal, I use:
Code:
shutdown -h now
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.
 
Old 06-04-2014, 12:51 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,799

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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...
 
1 members found this post helpful.
Old 06-04-2014, 12:53 AM   #4
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
I love history. Thanks.
 
Old 06-04-2014, 03:31 AM   #5
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
As an alternative, I tend to use
Code:
halt -i0 -g0 -y
I believe
Code:
halt
does just that... It stops further processing and the everything is in a halted state. I think that
Code:
continue
at this point would resume any processes which were halted.

BTW, In the words of Egon Spengler, I believe that
Code:
halt
then powering down via the big grey button is a BAD thing, as you could lose data. You should use
Code:
halt
sync
sync
instead to write any cached info back to disk before powering off.

IBM, (doncha love 'em; dasd = Disk, ROS = ROM) have to be different with
Code:
halt -F
used to shut down AIX boxes as I recall.

Play Bonny!


Last edited by Soadyheid; 06-04-2014 at 03:33 AM.
 
Old 06-04-2014, 03:42 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,799

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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).
 
Old 06-04-2014, 05:10 AM   #7
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
@pan64
You are, of course, absolutely correct. Is there not a way out of a halt situation? I thought there was. Maybe I'm confusing it with a
Code:
<stop> A
on a Sun box which drops you to the OK prompt where
Code:
continue
will resume.

Play Bonny!

 
Old 06-04-2014, 08:46 AM   #8
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
Thanks for the insights!

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.
 
Old 06-04-2014, 10:21 AM   #9
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
I normally, to turn my computer off as root just type
Code:
poweoff
Or
Code:
sudo poweroff
in a sudo base distro like Ubuntu

Last edited by TroN-0074; 06-04-2014 at 10:22 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
eclipse brings my computer to an almost halt eantoranz Linux - Software 6 03-07-2013 02:58 PM
Wireless Slows down computer to a halt ShadowHywind Linux - Wireless Networking 4 07-08-2007 01:36 AM
turn off after halt comand spank Linux - Newbie 18 08-02-2006 10:19 PM
can't halt the computer Latem Mandriva 10 04-15-2006 10:09 PM
halt -p can't turn off power in debian lsj Linux - Newbie 2 04-05-2004 05:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration