LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-02-2010, 11:37 PM   #31
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 8,261

Rep: Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570Reputation: 1570

If I'm using Slackware, su to root and shutdown now or shutdown now -H depending on whether the computer understands -H.

If I'm using something with a graphical login screen (Debian, Ubuntu), I use the menu.

I use sudo only if I have no choice. I'm an su kind of guy.
 
Old 12-03-2010, 12:45 AM   #32
Timothy Miller
Member
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian Jessie, OpenSuse 13.1, Chakra.
Posts: 726

Rep: Reputation: 114Reputation: 114
Quote:
Originally Posted by Kenny_Strawn View Post
Not clicks, keystrokes. There's a difference.
The keys still click on every keyboard I own. A click is a click is a click, regardless of whether it's made by a mouse or a key.

So I still maintain 3 clicks is easier than 15.
 
Old 12-03-2010, 09:20 AM   #33
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
I use "sudo shutdown -h now", and even configured sudo not to require a password for the shutdown command. But I should probably use the power button, I guess it's time to get acpi working.

Anyway, in older computers, the power button actually switched off power the the computer. Now it notifies the OS, which can choose what to do.
 
Old 12-04-2010, 09:07 AM   #34
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Rep: Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027
Quote:
Originally Posted by dv502 View Post

BTW, I noticed some members say they just press the power button to shutdown the system, but isn't this bad? Linux needs to unmount filesystems and sync disks and etc before quiting.
If I just powered-off at the wall socket then that's what you'd see and yes, an unclean shutdown is still a very bad thing to do. However, though most desktop systems still have a real power switch on the back of the psu, the power button on the front hasn't been a true power switch for a good number of years now, and will just generate an acpi event when pressed. It's up to the OS to decide what to do at that point. Recent versions of Slackware will respond by doing a clean shutdown.
 
Old 12-14-2010, 06:14 PM   #35
A.Thyssen
Member
 
Registered: May 2006
Location: Brisbane, Australia
Posts: 119

Rep: Reputation: 32
Your poll is missing an entry...

Desktop Power Control.

All the desktops and even the login screens provide a method to poweroff laptops and desktops.

On the other hand servers do not provide that capability (for obvious reasons).


You are also missing the very obvious "poweroff" command!!!!
which of course could be using ANY of the polled command line methods.
 
Old 12-14-2010, 06:25 PM   #36
Amdx2_x64
Member
 
Registered: Jun 2008
Distribution: Left LQ. Mods are too Rude!
Posts: 598

Rep: Reputation: 50
Usually for me I end up watching a movie when I fall asleep. So I use shutdown -h -P 120 (or however many minutes are left in the movie.)

Last edited by Amdx2_x64; 12-14-2010 at 07:03 PM. Reason: Brain half working tonight, wrote the wrong thing.
 
Old 12-14-2010, 06:40 PM   #37
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 223Reputation: 223Reputation: 223
Halt gets the job done.
 
Old 12-15-2010, 06:07 AM   #38
AlienWolf
LQ Newbie
 
Registered: Dec 2010
Distribution: Ubuntu, RHEL, CentOS
Posts: 7

Rep: Reputation: 0
Tend not to issue shutdown commands from a terminal on my local PC any more.
Always have many ssh sessions open to critical servers, only one key away from an oops moment
 
Old 12-15-2010, 06:15 AM   #39
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by Amdx2_x64 View Post
Usually for me I end up watching a movie when I fall asleep. So I use shutdown -h -P 120 (or however many minutes are left in the movie.)
And what do you use to watch movies on the computer? Do you have a TV tuner card (that actually works under Linux) or do you watch on the Internet?
 
Old 12-15-2010, 06:45 AM   #40
prodev05
Member
 
Registered: Jul 2009
Location: Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
shutdown -h now : is the proper way to shutdown a server. Because the shutdown command will wait until the process is getting finished and proceed to shutdown the server

init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.

halt : To shutdown the server Immediately.

poweroff : Just crash the FS and other sensitive process and power off the hardware.

Issuing "shutdown -h now" command is the best practice for production environment



Thanks

Last edited by prodev05; 12-21-2010 at 05:57 AM.
 
0 members found this post helpful.
Old 12-15-2010, 07:53 AM   #41
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by prodev05 View Post
Issuing "shutdown -h now" command is the best practice for production environment



Thanks
Really ? Well, thanks for making it so big, so we can see it even if we're blind.

Last edited by H_TeXMeX_H; 12-15-2010 at 07:55 AM.
 
1 members found this post helpful.
Old 12-15-2010, 07:56 AM   #42
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by prodev05 View Post
shutdown -h now : is the proper way to shutdown a server. Because the shutdown command will wait until the process is getting finished and proceed to shutdown the server

init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.

halt : To shutdown the server Immediately.

poweroff : Just crash the FS and other sensitive process and power off the hardware.

Issuing "shutdown -h now" command is the best practice for production environment



Thanks
What about /etc/init.d/halt stop?
 
1 members found this post helpful.
Old 12-15-2010, 07:57 AM   #43
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,148
Blog Entries: 52

Rep: Reputation: Disabled
I've heard of warnings: Always read the small print, but that's ridiculous!
 
1 members found this post helpful.
Old 12-15-2010, 08:16 AM   #44
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
shutdown -h now : is the proper way to shutdown a server. Because the shutdown command will wait until the process is getting finished and proceed to shutdown the server

init 0 : This command is logically to tell the Operating environment to switch the runlevel. This will kill all the process with out wait.

halt : To shutdown the server Immediately.

poweroff : Just crash the FS and other sensitive process and power off the hardware.

Issuing "shutdown -h now" command is the best practice for production environment
This advise is BS if you ask me. From the halt/poweroff/reboot manpage:
Quote:
If halt or reboot is called when the system is not in runlevel 0 or 6, in other words when it's running normally, shutdown will be invoked instead.
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!
 
1 members found this post helpful.
Old 12-15-2010, 08:17 AM   #45
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
What a fantastic thread!
 
  


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 07:43 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