LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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


View Poll Results: What is your preferred command for shutting down the system?
sudo init 0 8 13.79%
sudo halt 11 18.97%
sudo /etc/init.d/halt stop 1 1.72%
sudo shutdown -H now 40 68.97%
Multiple Choice Poll. Voters: 58. You may not vote on this poll

Reply
  Search this Thread
Old 12-02-2010, 10:37 PM   #31
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141

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-02-2010, 11:45 PM   #32
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
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, 08:20 AM   #33
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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, 08:07 AM   #34
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
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, 05:14 PM   #35
A.Thyssen
Member
 
Registered: May 2006
Location: Brisbane, Australia
Distribution: linux
Posts: 158

Rep: Reputation: 44
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, 05: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 06:03 PM. Reason: Brain half working tonight, wrote the wrong thing.
 
Old 12-14-2010, 05:40 PM   #37
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 224Reputation: 224Reputation: 224
Halt gets the job done.
 
Old 12-15-2010, 05: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, 05: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

Original Poster
Blog Entries: 62

Rep: Reputation: 56
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, 05:45 AM   #40
prodev05
Member
 
Registered: Jul 2009
Location: Planet 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 04:57 AM.
 
0 members found this post helpful.
Old 12-15-2010, 06:53 AM   #41
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
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 06:55 AM.
 
1 members found this post helpful.
Old 12-15-2010, 06: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

Original Poster
Blog Entries: 62

Rep: Reputation: 56
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, 06:57 AM   #43
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

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, 07:16 AM   #44
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 07: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



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



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:12 PM.

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