Results 1 to 10 of 13
Just wondering what the difference between
halt
and
shutdown -h now
really is? They both lead to the same thing; turn the computer off. But is one preferable to the ...
- 06-19-2006 #1Linux User
- Join Date
- Jan 2006
- Posts
- 414
halt vs. shutdown
Just wondering what the difference between
halt
and
shutdown -h now
really is? They both lead to the same thing; turn the computer off. But is one preferable to the other, or what is the difference?
Ta
- 06-19-2006 #2
There's not much difference, infact as I remember, halt calls shutdown, as does reboot, it's just simpler to do shutdown: halt, reboot: reboot.
- 06-19-2006 #3
Some Grumpy Gus background rambling here, which gives a little background on how halt and reboot have be altered to call shutdown, which really should be the thing that's called in most cases anyway. Shutdown is the gold standard - it gently shuts down processes. Personally, I had a perverse sense of joy typing in "init 0" when I was younger, just because it's so brutish.

DT
- 06-19-2006 #4Linux User
- Join Date
- Jan 2006
- Posts
- 414
Thanks guys, that link was helpfull too.
I've been working on a little script to allow all users to shutdown the system, and wasn't sure whether it should invoke 'halt' or 'shutdown -h now'
Have now gone for the latter.
Would anyone like to try the script? I've run it on my laptop and it worked great.
- 06-19-2006 #5Linux Enthusiast
- Join Date
- Jun 2005
- Posts
- 668
If you just configured sudo you wouldnt need the script
I have sudo entries for user 'kernow' and he can shut down the pc with the normal 'halt' command.
if you so wanted you could make a group called 'shutdowners' and then add this to /etc/sudoers, then add people you want to be able to shutdown the computer - to the 'shutdowners' group
- 06-19-2006 #6Linux User
- Join Date
- Jan 2006
- Posts
- 414
I was going to do something like that, but I haven't written a shell script before and thought this would be a good little exercise.
The script checks that sudo is installed, downloads and installs it if it's not, changes /etc/sudoers to allow all users to issue the shutdown command, and simplifies the command a little so that just entering 'shutdown' in terminal will execute 'sudo shutdown -h now'.
I eventually want to make so that it will add a shutdown entry to the Fluxbox menu to enable a 'point and click' shutdown from the GUI.
- 06-20-2006 #7Linux Enthusiast
- Join Date
- Jun 2005
- Posts
- 668
I have an entry on my fluxbox menu just for that.
it just runs 'sudo halt'
- 06-20-2006 #8Linux User
- Join Date
- Jan 2006
- Posts
- 414
Yeah that's what i wanna do, I just felt like writting a script to do it.
- 06-20-2006 #9Linux Enthusiast
- Join Date
- Jun 2005
- Posts
- 668
but your script just adds the entries to /etc/sudoers anyway, pointless having a script really when you could just add the user(s) to /etc/sudoers manually, then just run 'sudo halt' from the command line or your fluxbox menu.
Originally Posted by darkrose0510
if you still wanted to use 'shutdown' instead of 'shutdown -h now' you could just create a BASH alias in ~/.bash_profile
ah well. it was fun scripting right?
- 06-20-2006 #10Linux Engineer
- Join Date
- Apr 2005
- Location
- Buenos Aires, Argentina
- Posts
- 908
poweroff, halt, shutdown, reboot, they're all the same
serzsite.com.ar
"All the drugs in this world won\'t save you from yourself"


Reply With Quote