43

I have a fresh installation of Ubuntu Server. "reboot" works, but shutdown fails on the * Killing all remaining processes... step. I am using:

sudo shutdown now

After the failure, indicated by [fail] (with "fail" in red), I get this message:

 * will now switch to single-user mode

with no other error messages. The user is root after the program exits.

Any ideas about how to trouble-shoot this, or what the problem might be?

The Ubuntu version is 11.10 and I ran sudo aptitude update && sudo aptitude dist-upgrade before this.

jtpereyda
  • 2,447
  • 3
  • 23
  • 29

3 Answers3

38

I've experienced the same, so I had to use halt which worked

shutdown -h now
Zdenek F
  • 496
  • 4
  • 5
  • 3
    This may require sudo to run – Simon Sheehan Jan 20 '12 at 01:20
  • Is there any explanation on why this is necessary? I have the above problem on a 13.10 distro and even the "shutdown -h now" variant does not work. The only way I can recover from this -- it seems -- is to `reboot -f now` but this skips the whole shutdown process and can't be good for the long-term health of the system. – ken Nov 27 '13 at 18:45
  • This works, though not really sure why the other one fails. – Nuno Furtado Dec 02 '13 at 14:04
  • 1
    @user19726 - see other answers for why the simple shutdown "fails" (it is actually not failing, it is simply going to single user mode, rather than straight to halt condition). – qxotk Mar 12 '14 at 15:32
21

From the man pages of shutdown:

... runlevel 1 is used to put to system into a state where administrative tasks can be per- formed; this is the default if neither the -h or -r flag is given to shutdown."

shutdown shuts the system down from a user perspective, as linux is designed as a multi-user system, hence the system-wide message and optional time delay.

To shutdown the machine, use the -h option.

And I wouldn't worry about some processes that couldn't be killed in time, which is probably the meaning of the [fail] message you got.

Léo Lam
  • 69
  • 1
  • 1
  • 10
Markus
  • 356
  • 2
  • 5
  • As a total Noob to Linux, and seeking to up my skills, I prefer to *be worried* about *anything* that fails. I want to know Linux to the point where I can run in on the open public internet. That said, I voted for this answer: quotes the man page and explains the default behavior. I'm tempted to remove the "And I wouldn't worry..." at the end - what value does that add? – qxotk Mar 12 '14 at 15:27
7

I encountered this when trying to reboot with sudo reboot now. sudo shutdown now also failed. In both cases, the system switched to single-user mode and stalled.

Halting the system isn't feasible, since it is remote and I don't want to trek to the basement to turn it back on. What worked is sudo shutdown -r 0.

I'm running Ubuntu 13.04 server on an Asus Aspire One netbook.

I know this thread is old, but I'm experiencing this problem with a current distro.

MattM
  • 71
  • 1
  • 1
  • 1
    Thanks for posting this: Ubuntu 13.04 refused to reboot properly without the `shutdown -r 0` command. – ojdo Sep 27 '13 at 22:44
  • 1
    `sudo shutdown -h -r` worked for me, not sure on the differences. – Tracker1 Nov 19 '13 at 22:01
  • Voted this up for adding perspective for the person running a physical not-nearby machine - not everyone is in a situation to turn the machine off - I am because: using a VM locally and in the cloud - both places where a machine can be turned off and started via locally available keyboard/cloud control panel. – qxotk Mar 12 '14 at 15:30