LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   I'm done here! (https://www.linuxquestions.org/questions/linux-general-1/im-done-here-847589/)

Kenny_Strawn 11-30-2010 10:48 PM

I'm done here!
 
What is your preferred command for shutting down the system? Please explain your votes.

mlangdn 11-30-2010 10:53 PM

I never use sudo, only su and sometimes su -
shutdown -H now fills the bill.

H_TeXMeX_H 12-01-2010 04:35 AM

Ctrl-Alt-Del which runs 'shutdown -h now'. No, I don't use sudo.

teebones 12-01-2010 05:58 AM

that's not a common behavior.. ctrl + Alt + Del on most distro's executes "shutdown -r now", not "-h".

brianL 12-01-2010 06:03 AM

shutdown -h now, if I'm in runlevel 3.
KDE main menu -> Leave -> Shutdown, if I'm in runlevel 4.

GazL 12-01-2010 06:09 AM

I just press the power button on the front of my case. ACPI does the rest.

H_TeXMeX_H 12-01-2010 06:12 AM

Quote:

Originally Posted by teebones (Post 4176893)
that's not a common behavior.. ctrl + Alt + Del on most distro's executes "shutdown -r now", not "-h".

Yes, I changed it in inittab. I rarely need to restart.

devnull10 12-01-2010 06:21 AM

Code:

poweroff

honeybadger 12-01-2010 07:24 AM

Changed the /etc/inittab and ctrl+alt+del powers the pc off.

Larry Webb 12-01-2010 07:48 AM

shutdown -h if I am trying to impress someone otherwise just the powerbutton.

brianL 12-01-2010 07:59 AM

Quote:

Originally Posted by Larry Webb (Post 4177013)
shutdown -h if I am trying to impress someone otherwise just the powerbutton.

Good answer. :)

mlangdn 12-01-2010 08:07 AM

I remember using "park".

H_TeXMeX_H 12-01-2010 08:37 AM

My power button is under a panel, and is hard to reach, that's why I use Ctrl-Alt-Del. This combo also exits fluxbox.

druuna 12-01-2010 08:38 AM

sudo??

I use ctrl-alt-del most of the time.

Inittab entry is changed to: ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now, besides root, only 1 other user has the power to shut down the system.

@mlangdn: park, I remember that command too!!

@H_TeXMeX_H: Happy birthday to you, happy birthday to you, happy .........!

H_TeXMeX_H 12-01-2010 08:43 AM

heh, thanks

TobiSGD 12-01-2010 09:15 AM

I almost never power my systems off in the normal meaning of the word. I just press the power button and my systems go to hibernation. But if I want to do it I use my openbox menu or do sudo poweroff.

dv502 12-01-2010 01:24 PM

shutdown -h now without sudo because I'm using arch

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.

I remember back in the mid 90s when I once in awhile press the power button off. And when I went to turn on the computer I was confronted with the fsck message because linux didn't shutdown properly.

Those of you who just press the power off button, do you get the fsck message when you turn on the computer again?

If not, it's probably because the filesystem of today is more robust than that from the early to mid 90s. Just my guess.

H_TeXMeX_H 12-01-2010 02:17 PM

Technically I can press the power button and it will shutdown normally and without filesystem errors (regular shutdown), it's only if I hold the button down that it will shutdown in a bad way.

phil.d.g 12-01-2010 02:27 PM

No, it's because these people have acpi configured. When you press the power button it initiates a normal shutdown procedure. To force a hardware shutdown you have to hold the power button for 3 seconds.

My laptop is configured to hibernate if you press the power button, so I use it. The desktop stays on all the time, it only gets restarted for kernel updates.

TobiSGD 12-01-2010 03:36 PM

Quote:

Originally Posted by dv502 (Post 4177323)
shutdown -h now without sudo because I'm using arch

That means that you don't need root-privilegues in Arch? Or that you are working as root?

frieza 12-01-2010 04:43 PM

Quote:

Originally Posted by mlangdn (Post 4177031)
I remember using "park".

haha yeah i remember that too, i forget which version of DOS that was or if PARK was an external command specific to machines older then self parking hard drives

back on topic i use poweroff

lupusarcanus 12-01-2010 04:47 PM

I like to stay up on the latest technology; I use the PowerButton.

silvyus_06 12-01-2010 05:25 PM

i don't use neither of those :
I let GNOME do the hard job for me ;)

dv502 12-01-2010 05:48 PM

Quote:

Originally Posted by TobiSGD (Post 4177463)
That means that you don't need root-privilegues in Arch? Or that you are working as root?

I think you misunderstood my post or I didn't give the whole picture.

When I said I use shutdown -h now, this is after I log in as root.

I do everything as a regular user and when I'm ready to shutdown, I log in as root and type the command above.

I could give my regular user the privilege to shutdown the machine, but I won't because I'm old school. I like to follow the old tradition of unix where root is the almighty and regular users are just users with limited privileges.

- Cheers

Kenny_Strawn 12-02-2010 05:49 AM

I technically wouldn't recommend sudo /etc/init.d/halt stop as it would halt the system *IMMEDIATELY* without shutting down system daemons/services first, which in turn crashes those apps and can cause loss of data.

And sudo init 0 initializes the system to runlevel 0, which basically shuts down the system. sudo halt does the same thing as well.

In my opinion, it's all a matter of personal preference.

MrCode 12-02-2010 05:38 PM

I don't have sudo on my system (I prefer to actually remember my root password TYVM :rolleyes:), but I do use init 0 if I want to shut down from the CLI as root (or init 6 to reboot). Easier to type that way, I think. :)

Code:

$ su -c "init 0"
Most of the time, though, I do it from Xfce: Quit->Shutdown ("Quit" is the button on the very right side of the Xfce panel).

eveningsky339 12-02-2010 08:27 PM

I use a power button.

Timothy Miller 12-02-2010 08:36 PM

K menu > Leave > Shutdown. Why do in 15-20 clicks what I can do in 3?

Kenny_Strawn 12-02-2010 10:01 PM

And has anybody commented on /etc/init.d/halt stop yet?

Kenny_Strawn 12-02-2010 10:03 PM

Quote:

Originally Posted by Timothy Miller (Post 4178972)
K menu > Leave > Shutdown. Why do in 15-20 clicks what I can do in 3?

Not clicks, keystrokes. There's a difference.

frankbell 12-02-2010 10:37 PM

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.

Timothy Miller 12-02-2010 11:45 PM

Quote:

Originally Posted by Kenny_Strawn (Post 4179021)
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.

MTK358 12-03-2010 08:20 AM

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.

GazL 12-04-2010 08:07 AM

Quote:

Originally Posted by dv502 (Post 4177323)

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.

A.Thyssen 12-14-2010 05:14 PM

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.

Amdx2_x64 12-14-2010 05:25 PM

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.)

disturbed1 12-14-2010 05:40 PM

Halt gets the job done.

AlienWolf 12-15-2010 05:07 AM

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 ;)

Kenny_Strawn 12-15-2010 05:15 AM

Quote:

Originally Posted by Amdx2_x64 (Post 4191560)
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?

prodev05 12-15-2010 05:45 AM

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 :hattip:

H_TeXMeX_H 12-15-2010 06:53 AM

Quote:

Originally Posted by prodev05 (Post 4192194)
Issuing "shutdown -h now" command is the best practice for production environment



Thanks :hattip:

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

Kenny_Strawn 12-15-2010 06:56 AM

Quote:

Originally Posted by prodev05 (Post 4192194)
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 :hattip:

What about /etc/init.d/halt stop?

brianL 12-15-2010 06:57 AM

I've heard of warnings: Always read the small print, but that's ridiculous!

druuna 12-15-2010 07:16 AM

Hi,
Quote:

Originally Posted by prodev05 (Post 4192194)
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!

lupusarcanus 12-15-2010 07:17 AM

What a fantastic thread!

X.Cyclop 12-15-2010 10:30 AM

I use (su -) shutdown -h +1. :)

Latios 12-15-2010 12:39 PM

from kde

su -c init 0

alt ctl del, then switch off the power as soon as i hear the click of the stopped hard drive



Back when i used Gentoo and manually startx'ed into kde i wrote /bin/init.sh (the real init is /sbin/init)
Code:

#!/bin/bash
sudo init $1

so i could write init 0 as user. Now i usually shut down from within kde so dont mind typing some more when i am in the vt which is not often (i usually use konsole and not real vt)

foodown 12-15-2010 01:04 PM

I like the simplicity of 'halt.'

Somehow I can't shake the idea now that "Issuing 'shutdown -h now' command is the best practice for production environment."

It's inexplicable. ;)

prodev05 12-15-2010 11:47 PM

Sorry H_TeXMeX_H, For making big fonts :(


foodown If you are really experienced and you know what you are doing with commands, then you are right :). Because its your experience and your understanding about the halt commands. Its not inexplicable, because situations varies up on using commands(shutdown or halt)


Who ever want to use their commands can use. But before that please read the man page one. :D


Thanks :hattip:

foodown 12-15-2010 11:55 PM

Quote:

Originally Posted by prodev05 (Post 4193109)
Sorry H_TeXMeX_H, For making big fonts :(


foodown If you are really experienced and you know what you are doing with commands, then you are right :). Because its your experience and your understanding about the halt commands. Its not inexplicable, because situations varies up on using commands(shutdown or halt)

I apologize, man.

I was just trying to make light of the big fonts situation.

For the record, you are correct in your assertion (I think).

@Kenny:
Out with it already! What more are you dying to share with us about '/etc/init.d/halt stop'? :)


All times are GMT -5. The time now is 08:09 PM.