Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was trying to shutdown my PC through SSH. I executed

sudo shutdown now

The user was logged-out and Ubuntu starting turning off, but it froze at the last screen with the Ubuntu logo and the loading dots. Any idea where the problem might be?

Also, what's the difference between shutdown and halt? What other similar commands are there?

share|improve this question
Does it work if you run "sudo shutdown -P now"? – Eliah Kagan Oct 30 '11 at 2:04
or sudo shutdown -h now – rigved Oct 30 '11 at 5:36
+1 for question. I just had this exact same problem. – boehj Oct 29 '12 at 1:24
btw: this (also) works from all (other) tty terminals :-) – nutty about natty Feb 13 at 7:54

1 Answer

up vote 7 down vote accepted

From the MAN PAGES:

Shutdown - "shutdown arranges for the system to be brought down in a safe way. All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented." Time mentioned here is an amount specify by the user that is shutting down.

Halt - "These programs allow a system administrator to reboot, halt or poweroff the system."

The difference is that Halt can be more "aggressive" when shutting down than Shutdown itself. It has parameters than can literally force the system to shutdown without regarding services or opened programs. If you run halt without any parameters it will simply execute the shutdown command. Something like an alias. If you run it for example with the parameter --force it will "force" it will force the system into a reboot really fast.

In the case of halt or shutdown, they will wait for all processes to finish correctly before turning the PC off or rebooting. If a service or app does not close or does not close properly you will see what you mention there (The ubuntu logo with the dots).

The proper way in the terminal for a single user or multi user is shutdown. But if the shutdown is not working verify what services you have running and which one is causing the slowness or freezing of the shutdown.

share|improve this answer
2  
So how come Ubuntu shuts down properly when doing it using the shutdown button in the top bar? How is that different from the terminal command? Why does that work and the terminal command doesn't? It's pretty strange ... – Richard Rodriguez Oct 30 '11 at 2:03
7  
@RiMMER shutdown shuts down the OS, but doesn't actually turn off the computer. You need either an extra argument, like shutdown -P, or to call poweroff instead. (They're the same.) The complete list of similar commands is reboot, halt, poweroff and shutdown. – j-g-faustus Oct 30 '11 at 4:56
For my case the laptop never powers off with the shutdown button inside unity or the command itself. – Luis Alvarado Oct 30 '11 at 14:40
How do spawn it from XMonad? ("M-S-k", spawn "sudo shutdown now -P") doesn't work. – asattar Nov 18 '11 at 9:36
would 'shutdown -P' also work from tty1 (to also shut down tty7 and power-off the machine)? – nutty about natty Feb 13 at 7:35
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.