LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Poll: What is your preferred command for shutting down the system?
Be advised that this is a public poll: other users can see the choice(s) you selected.
Poll Options
What is your preferred command for shutting down the system?

You must log in and have one post to vote in this poll. If you don't have an account, you can register here.
Results will be available after the polls close.

The nominees are:

sudo init 0
sudo halt
sudo /etc/init.d/halt stop
sudo shutdown -H now

Reply
 
Search this Thread
Old 12-21-2010, 08:32 AM   #61
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714

I set this script to run when i click the appropriate Openbox menu item:

Code:
#!/bin/sh

gxmessage 'Do you want to quit X?' \
	-buttons 'Cancel:1,Quit X:2,Reboot:3,Shut Down:4'

case $? in
    2)
	killall X
	;;
    3)
	sudo shutdown -r now
	;;
    4)
	sudo shutdown -h now
	;;
esac
 
Old 12-22-2010, 12:46 AM   #62
prodev05
Member
 
Registered: Jul 2009
Location: Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Lightbulb

To ALL

If my 40'th post is abuse due to over size issue. Then report the following thread also as abuse. I don't know who is that brilliant reported my post as abuse. Any how my heart full congrats for spoiling my reputation.

Moderator/Admin:

If you thing the bigger size font is abuse, then try to disable the font size. If you are unable to do this, don't believe your self as a admin.

reg

Arun

"Think twice before spoiling others reputation. It also doesn't means we should not report. We should report if that is only ABUSE "
 
Old 12-22-2010, 01:01 AM   #63
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Relax prodev, your reputation is far from ruined.
 
Old 12-22-2010, 01:01 AM   #64
prodev05
Member
 
Registered: Jul 2009
Location: Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Quote:
Originally Posted by druuna View Post
Hi,

This advise is BS if you ask me. From the halt/poweroff/reboot manpage:

Are you still using a sysvinit prior to version 2.74? Those older version did not call shutdown.

init 0 also produces a clean shutdown.

BTW: Shouting doesn't make it so!


Well you are correct because of your understanding. While suggest some thing to others, suggest that in a standard way. You can suggest them to use init 0 also. What would happen if oracle or any production DB is running and you are using init 0. You would be fired from the company.

BTW: Shouting doesn't make it so! you understood that the lower case words mean shouting. NOW THIS IS SHOUTING.

Note: Again don't consider this as rude

Reg,

 
0 members found this post helpful.
Old 12-22-2010, 01:09 AM   #65
Mrpnut08
LQ Newbie
 
Registered: Dec 2010
Location: Panama
Distribution: Fedora , Ubuntu
Posts: 21

Rep: Reputation: 0
"Shutdown -h now" for 2 main reasons:
1- It works on every single Distro out-of-box
2- i can replace "now" for a timed shutdown and leave my computer downloading/processing stuff and forget about it

I like to leave my computer on overnight or when im not at home downloading/processing stuff
(no time wasted during my "active" hours)
 
Old 12-22-2010, 02:58 AM   #66
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,013

Rep: Reputation: 83
I remember using:
Code:
sync
sync
halt
But now I use:
Code:
shutdown -h now
 
Old 12-22-2010, 03:06 AM   #67
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,
Quote:
Originally Posted by prodev05 View Post
Well you are correct because of your understanding. While suggest some thing to others, suggest that in a standard way. You can suggest them to use init 0 also.
I thought I was pretty clear in my reply about what is save to use, including a little warning about sysvinit versions prior to 2.74.

Quote:
What would happen if oracle or any production DB is running and you are using init 0. You would be fired from the company.
????? Why?? As stated before, init 0 creates a clean shutdown. It sure looks like you don't grasp the linux init concept. Don't keep spreading disinformation!!

Quote:
BTW: Shouting doesn't make it so! you understood that the lower case words mean shouting. NOW THIS IS SHOUTING.
Using caps only is a classic way to virtually shout, using font size 6 is also shouting (or maybe just plane rude, which should be clear to you by now).

Quote:
Note: Again don't consider this as rude
Nope, not rude, just annoying. If you give information that is incorrect, please be man enough to admit that.
 
Old 12-22-2010, 05:01 AM   #68
prodev05
Member
 
Registered: Jul 2009
Location: Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Talking

Quote:
Originally Posted by druuna View Post
Hi,
I thought I was pretty clear in my reply about what is save to use, including a little warning about sysvinit versions prior to 2.74.

????? Why?? As stated before, init 0 creates a clean shutdown. It sure looks like you don't grasp the linux init concept. Don't keep spreading disinformation!!

Using caps only is a classic way to virtually shout, using font size 6 is also shouting (or maybe just plane rude, which should be clear to you by now).

Nope, not rude, just annoying. If you give information that is incorrect, please be man enough to admit that.
Ok I've learned the modern way to yell. Thanks for that.

The concept is not static to admit myself and the information which I gave is not incorrect its 100% correct. Because I itself using those commands for 1600+ Linux server. The command is suggested by a famous developer(co-author of Perl and mainframe) he is a legend using Unix from his childhood and Linux from the age <output truncated>

I didn't mentioned that "init 0" is a wrong command. I clearly mentioned that scenarios will define to use what command in situations. You didn't understand that lol. If I admit my self "shutdown -h now" command is wrong. What is going to happen? are you going to suggest Linux users not to use shutdown command !!!!. Always think practically. I'm ready to admit myself if I committed a mistake. I don't think I committed a mistake. If you feel that, then you start a poll.

Any how all the best and one more thing, never annoy others, think of it twice and try to make them understand about what your brain is thinking. From there you will win by exploring your idea. Not all human beings in the world is thing in the same way. That is the great invention of god.

Last edited by prodev05; 12-22-2010 at 05:25 AM.
 
Old 12-22-2010, 05:38 AM   #69
prodev05
Member
 
Registered: Jul 2009
Location: Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Lightbulb

Dear Guru druuna ,

You didn't vote in this poll didn't you ?
 
Old 12-22-2010, 07:47 AM   #70
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by prodev05 View Post
Dear Guru druuna ,
You didn't vote in this poll didn't you ?
No I did not, and if you would have read my other reply (post #14) you would have known why......
 
Old 12-22-2010, 08:20 AM   #71
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
@prodev05:
Quote:
The concept is not static to admit myself and the information which I gave is not incorrect its 100% correct.
No, it is not 100% correct.
Suggesting to use shutdown -h now is (half) good advise. Half? you ask? The -h now part isn't, you should give users the time to save their work, especially in a test/acceptance/production environment which has probably more then one user connected to the box that needs to be shut-down.

The reasons you gave for not using halt, init 0 (twice) and poweroff are BS (I already explained why in my previous posts).

Quote:
Because I itself using those commands for 1600+ Linux server. The command is suggested by a famous developer(co-author of Perl and mainframe) he is a legend using Unix from his childhood and Linux from the age <output truncated>
If one uses (older) proprietary Unix systems things could be different, but you should have mentioned that and also have stated that modern Linux (and Unix) system do not have these limitations.

Quote:
I didn't mentioned that "init 0" is a wrong command.
Yes you did! Twice!

post #40: init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.
post #64: You can suggest them to use init 0 also. What would happen if oracle or any production DB is running and you are using init 0. You would be fired from the company.

Quote:
I clearly mentioned that scenarios will define to use what command in situations. You didn't understand that lol.
I guess I still "don't understand". If your box is set up correctly, using init 0 will do no harm to any of your running programs. And yes, one should be aware of the system one is working on/with.

Quote:
If I admit my self "shutdown -h now" command is wrong. What is going to happen? are you going to suggest Linux users not to use shutdown command !!!!. Always think practically. I'm ready to admit myself if I committed a mistake. I don't think I committed a mistake. If you feel that, then you start a poll.
I never mentioned anywhere that using shutdown -h now is wrong in any way. I did say that what you mentioned in all of post #40, and the way you wrote it down was incorrect. Please don't take things out of context!

Quote:
That is the great invention of god.
Religion doesn't have anything to do with all this.


@Kenny_Strawn (and all others in general): Sorry for sidetracking this thread, I'll refrain from giving any more comments (I.e: I'm done here! ).
 
Old 12-22-2010, 10:13 AM   #72
prodev05
Member
 
Registered: Jul 2009
Location: Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Good catch with colorful fonts. Yes I'm wrong lol....
 
Old 12-24-2010, 04:27 AM   #73
-kg-
LQ Newbie
 
Registered: Jan 2010
Location: Godfrey, IL
Distribution: Ubuntu, Fedora, OpenSUSE, Knoppix, Puppy
Posts: 24

Rep: Reputation: 0
I use a 2X4....

"When I say whoa,
I mean WHOA!!"


Otherwise, nothing fancy...I click the Indicator Applet (Ubuntu) and select either "Shutdown" or "Restart." If I'm in terminal mode, I hit Ctrl/Alt/Delete and let Linux do its thing.
 
Old 12-25-2010, 04:49 AM   #74
jpat1023
Member
 
Registered: Oct 2003
Location: USA
Distribution: Red Hat 9, Ubuntu 10; Windows Server 2003 and XP
Posts: 34

Rep: Reputation: 15
sudo shutdown -r now

Our servers rarely, if ever, need to be down indefinitely.....that would kinda defeat the purpose of being a server, but I digress.
 
Old 12-25-2010, 08:52 PM   #75
ShellyCat
Member
 
Registered: Jul 2007
Distribution: Slackware 13
Posts: 178

Rep: Reputation: 28
Post

I've seen all sort of reasons why one method is safer than another, but these discussions are mostly meaningless because it really depends on the distro. On some distros, they are all links to the same actual command (as on Slackware). I type "halt" -- it's shorter!

[EDIT]"...but these discussions are mostly meaningless..." Not saying this discussion is meaningless (knowing your system, giving users notice the server will shut down, etc). I mean generally, posts (anywhere, anytime) which claim one command is better than another because one does safe shutdown and another does not. My comment was not referring to anything in this thread because I hadn't even read it yet, I just posted in response to the poll.[/EDIT]

Last edited by ShellyCat; 12-25-2010 at 09:02 PM. Reason: see above.
 
  


Reply

Tags
halt, init, shutdown


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 On
HTML code is Off



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