Shutting down via command line causes the system to hang on the shutdown screen

5,223

Solution 1

Check the file /etc/default/halt This file contains a variable setting that tells halt how it should behave.

OPTIONS

   The following variables can be set.

   HALT   If set to poweroff the system will be powered down after it  has
          been brought down. This is the default.
          If  set to halt the system will only be halted after it has been
          brought down. What exactly this means depends on your hardware.

   NETDOWN
          Setting this to no prevents  shutdown  from  shutting  down  the
          network  intefaces.   This  is  necessary  to  use  Wake-On-Lan.
          Setting it to yes causes shutdown to also bring down the network
          interfaces  (and  thus  prevent  the machine from being woken up
          remotely).

HALT is probably set to halt instead of poweroff.

From my system: more /etc/default/halt

# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff

Solution 2

My understanding that "halt" means exactly the behavior you're observing - all the processes are terminated and the machine is halted (i.e. "stays stuck ... just before shutting down") - which was the only possible behaviour in old days when machines had no ACPI capabilities - first you halt the machine and then flip the power switch manually.

A related command called poweroff gracefully terminates all processes and then issues an ACPI call which powers the machine off.

However, as Rinzwind points out, the exact behaviour of halt command can be changed by editing /etc/default/halt, so it is possible to make it to behave like poweroff.

Try

sudo poweroff

or

sudo shutdown -P now
Share:
5,223

Related videos on Youtube

TEst
Author by

TEst

Updated on September 18, 2022

Comments

  • TEst
    TEst over 1 year

    I am using Lubuntu 11.10, and the commands:

    sudo shutdown
    

    and

    sudo halt
    

    do not shutdown my system. Instead the computer hangs at the shutdown screen that appears just before powering off. From that point on it just does nothing. Any ideas on why this happens?

    • Eliah Kagan
      Eliah Kagan about 12 years
      What version of Lubuntu are you running? Does shutting down from the power menu on the upper-right corner of the screen also not work?
  • Janus Troelsen
    Janus Troelsen about 12 years
    well, I've been using halt for many years, and it turns off the PC here.
  • belacqua
    belacqua almost 12 years
    Why not just sudo shutdown -P now ?