How do I diagnose Hang on Shutdown?

17,167

You need to shutdown without the splash screen, and from the command line to see what's going on. First you need to disable splash via GRUB (See verbose shutdown)

Boot and hold SHIFT to enter grub. Press while over the linux entry to edit it. Then go to the kernel line (press END to go to the end of the line) and remove the "quiet" and "splash" arguments. In fact, for this one test skip out the GUI al together and add the argument "text". (Without this you can get to the command line with CTRL+ALT+F1)

Login, then type:

sudo shutdown -v -h now

(-v for verbose, -h for halt.)

Kernel log files in /var/log/kern.log should contain human readable time stamps. Open them with the log file viewer

gnome-system-log

(File>open) And you should see the human readable time stamp on the left. If you still don't see the human readable ones, this guy made some python/perl scripts to parse them.

Share:
17,167

Related videos on Youtube

Christoph
Author by

Christoph

Updated on September 18, 2022

Comments

  • Christoph
    Christoph almost 2 years

    Since one or two months ago, my laptop with ubuntu 12.10x64 hangs during shutdown. There's just a black screen, no harddisk activity, it justs sits there. I feel it happens near the end of a normal shutdown cycle, judging from time elapsed.

    Only resolution is hard power-off (holding power key for several seconds) - neither Ctrl-Alt-Backspace (which normally works, I have it switched on in Settings) nor Ctrl-Alt-Del help, nor can I get into a text console with Ctrl-Alt-F1.

    How do I diagnose that? It does not happen on every shutdown, but often enough to be annoying (as it forces a diskcheck on reboot, of course).

    Which log files can tell me what's going wrong? More or less blindly searching in the sys log viewer reminds me of needles in a haystack.

    I imagine I could pinpoint the time it happens via log timestamps, but how do I read timestamps like e.g. in kern.log: [36169.146130]? How do I get this human-readable?

    Lastly, a bit of a btw, I've never managed to execute an Alt-Sysrq-REISUB to force a cleaner shutdown, but that's probably because I'm on a laptop, PrintScr is only accessible via an Fn key, and I'm not sure of the exact key sequence I need. Is there a "harmless" but user-visible magic command I could practice this with (during normal operation), so I can find out how to do a REISUB next time?

    Thanks all! Comment if you need additional data...

  • Christoph
    Christoph over 11 years
    The problem is I can't reproduce it at will, it doesn't happen on every shutdown. But that question about quiet splash is gold, I'll remove those and wait for a hanging shutdown..
  • don.joey
    don.joey over 11 years
    This answer has interesting info. It does not anwers all of the OP's questions, though (as is clear from the "hope you get the issue resolved soon." remark). Can you expand, James?
  • James
    James over 11 years
    Sorry, I'd mainly gone for the rest of the question. I don't know of anything that could cause this because I'm not the most experienced linux user, however I was just throwing what I know about logging in for what it's worth to help the asker because they were asking for info on how to see shutdown logs. Eitherway, I added some more info answering the time stamp question.
  • Christoph
    Christoph over 11 years
    Ok, so I have activated logging on shutdown, just haven't experienced a hang on shutdown since then. I'll accept this answer.
  • Tfb9
    Tfb9 almost 9 years
    man shutdown does not show a -v option for me (using Ubuntu). Does it really exist?