Ubuntu 12.04 not shutting down properly

10,076

Solution 1

By default, the latest ubuntu install (12.04.2, and few others behind) hides messages and shows a nice animated image (splash) in a fancy resolution.

To make sure to view the console and possibly see what's hanging behind that dark screen:

/etc/default/grub (edit & save):

# find line below and put a # in front of it
# GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# and put this one:
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"

Now update grub boot entries with these new defaults:

you@yourmachine:~$ sudo update-grub

And at your next start/shutdown process, you should see message lines with [ OK ] or [ ERROR ] or something wrong following it's title:

* Starting network shares                   [ OK ]
* Starting mysql server                     [ OK ]
* ...later when shutting down...
* Stopping mysql server                     [ OK ]
* Not Stopping something like it should     [    ]

nomodeset: You usually can toggle between the splash screen and the console messages with Esc key, but some video cards or lack of drivers can't handle the mode/capacities the boot process is using. nomodeset ensures it's using basic common capacities and makes sure you see messages (provided you don't press ALT-F1 to F7 during boot/shutdown to view other terminals than the one used for services startup/shutdown).

Edit: You can also try without nomodeset if you run into troubles starting X. GRUB_CMDLINE_LINUX_DEFAULT=""

Solution 2

I am somewhat new to Ubuntu 12.04 but I had used other versions of Ubuntu in the past. I have my account plus the guess account for my kids on this computer and if any of the account is logged in when the command to shutdown is given the computer will not even attempt to shutdown. The only way to shut it down if one of the account still logged is by logging out all accounts first and then providing the command from the login screen. I will shut down fine from terminal using the "shutdown -h now" command. Unfortunately I have still much to learn in order to attempt to correct this issue on my own.

Solution 3

You can find the logs at /var/log/syslog

Check the logs to get a better understanding of what is happening.

Also, try typing init 0 in the terminal.

Share:
10,076

Related videos on Youtube

darryn.ten
Author by

darryn.ten

Freelance Developer, White Hat Hacker, Red Teamer, Crypto Junkie, AI Geek, Mentor, Beer Drinker. Have been in the game for over 25 years.

Updated on September 18, 2022

Comments

  • darryn.ten
    darryn.ten over 1 year

    When I shutdown or reboot my Ubuntu 12.04 it doesn't ever finish shutting down.

    I end up stuck on a black/blank screen and have to hold the power button to shut it down.

    Does anyone know where I can begin debugging this issue?

    Thanks in advance

    • Mitch
      Mitch almost 12 years
      Have tried modifying Grub?
    • darryn.ten
      darryn.ten almost 12 years
      No haven't modified GRUB. Worked fine before upgrading to 12.04
    • Mitch
      Mitch almost 12 years
      contents of /etc/default/grub please?
    • darryn.ten
      darryn.ten almost 12 years
      /etc/default/grub doesn't exist for me (?)
  • darryn.ten
    darryn.ten almost 12 years
    Last 2 lines in syslog don't show anything suspicious: - kernel: Kernel logging (proc) stopped. - rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="1066" x-info="rsyslog.com"] exiting on signal 15.
  • Will
    Will over 10 years
    Note that by doing this, you can also break your X settings and can result in your graphics driver not being loaded at boot. I would not recommend following bksunday's advice.
  • bksunday
    bksunday over 10 years
    I find it hard to view all the logs and find out what isn't working during shutdown. Would have loved to see your advice on the issue! Edited my answer now. Better? ;)
  • Will
    Will over 10 years
    Thanks for the prompt response. I am having the same problem as well and haven't found a fix it - adding nomodeset does not display the console messages at shutdown for me unfortunately. Once I find a solution, I'll post it. :)