LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 11:20 PM   #1
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 810

Rep: Reputation: 264Reputation: 264Reputation: 264
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, 01:22 AM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: OpenBSD
Posts: 1,644
Blog Entries: 8

Rep: Reputation: 577Reputation: 577Reputation: 577Reputation: 577Reputation: 577Reputation: 577
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, 01:51 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
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, 01:53 AM   #4
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: OpenBSD
Posts: 1,644
Blog Entries: 8

Rep: Reputation: 577Reputation: 577Reputation: 577Reputation: 577Reputation: 577Reputation: 577
I love history. Thanks.
 
Old 06-04-2014, 04:31 AM   #5
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 17.0 at present.
Posts: 1,167

Rep: Reputation: 201Reputation: 201Reputation: 201
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 04:33 AM.
 
Old 06-04-2014, 04:42 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
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, 06:10 AM   #7
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 17.0 at present.
Posts: 1,167

Rep: Reputation: 201Reputation: 201Reputation: 201
@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, 09:46 AM   #8
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 810

Original Poster
Rep: Reputation: 264Reputation: 264Reputation: 264
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, 11: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 11:22 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:58 PM
Wireless Slows down computer to a halt ShadowHywind Linux - Wireless Networking 4 07-08-2007 02:36 AM
turn off after halt comand spank Linux - Newbie 18 08-02-2006 11:19 PM
can't halt the computer Latem Mandriva 10 04-15-2006 11:09 PM
halt -p can't turn off power in debian lsj Linux - Newbie 2 04-05-2004 06:16 AM


All times are GMT -5. The time now is 02:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration