Ubuntu – Ubuntu 16.04 hangs on shutdown

16.04rebootshutdown

I know that there are other questions similar, but I will give more details about the problem.

When I try to shutdown/restart the system hangs forever.
This appens on Ubuntu 16.04 64bit. It appens on the same machine on an upgraded Kubuntu (14.04 ยป 16.04),
on a fresh installed Lubuntu 16.04 and event on a live CD (iso booted from hard-disk with grml-rescue).

It appens if I shutdown/restart from the Desktop Enviroment and if I do it from the terminal.

The issue is not appening on an Ubuntu 14.04 installed on the same hard-disk.

fdisk

I've tried to run a fdisk on the partition but no errors were found.

irqpoll

I've tried to add the irqpoll parameter to the system boot

linux /boot/vmlinuz-4.4.0-31-generic root=UUID=c50c612d-813b-4e76-a6d0-92e697658b7a ro irqpoll $vt_handoff

bios usb3

Someone has resolved by turning off usb3 legacy support on the bios, but my motherboard is very old, I have no usb3 support on the bios

systemctl and swap

This answer https://askubuntu.com/a/769953/23130
talked about 2 possible problems: systemctl and swap

sudo swapoff
sudo systemctl reboot

but none of theme work

shutdown debug

the previous answer pointed to an interesting Launchpad discussion
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1464917

where there is an introductive text that says:

If you are experiencing a shutdown hang, please file a separate bug report and follow the debugging instructions described in the
"Debugging boot/shutdown problems" section of /usr/share/doc/systemd/README.Debian.gz to check if there are any hanging jobs at shutdown.
Capturing a screen photo of "journalctl -b" in the rescue shell might be enlightening.

So the debbuging instructions says to

sudo systemctl enable debug-shell
sudo halt

then when the shutdown hangs you have a console on VT9 CTRL+ALT+F9 where you can do

systemctl

to find units with state active

systemctl list-jobs

all jobs listed are with state waiting, the only one with state running is upower.service which is bold.

So I powered off the PC and started again, now in a terminal I've done

sudo systemctl list-jobs

The output is

JOB UNIT           TYPE  STATE  
1341 upower.service start running
1 jobs listed.

so I tried to turn it off and disable it for the future

sudo systemctl stop upower.service
sudo systemctl disable upower.service
sudo systemctl mask upower.service

I then tried again to shotdown, with the debug console

sudo systemctl enable debug-shell
sudo halt

but the shutdown freezes as usual, plus now I cannot even access the debug-shell.

Booting without the quiet splash grub options I can see that the shutdown hangs on the output line

Reached target Shutdown

These are the syslog lines about the shutdown

Aug  5 11:45:12 pc-dev udisksd[2930]: Mounted /dev/sdc1 at /media/luca/TOSHIBA EXT on behalf of uid 1000
Aug  5 11:45:12 pc-dev ntfs-3g[3141]: Version 2015.3.14AR.1 integrated FUSE 28
Aug  5 11:45:12 pc-dev ntfs-3g[3141]: Mounted /dev/sdc1 (Read-Write, label "TOSHIBA EXT", NTFS 3.1)
Aug  5 11:45:12 pc-dev ntfs-3g[3141]: Cmdline options: rw,nodev,nosuid,uid=1000,gid=1000,uhelper=udisks2
Aug  5 11:45:12 pc-dev ntfs-3g[3141]: Mount options: rw,nodev,nosuid,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdc1,blkdev,blksize=4096
Aug  5 11:45:12 pc-dev ntfs-3g[3141]: Global ownership and permissions enforced, configuration type 7
Aug  5 11:45:16 pc-dev com.canonical.indicator.application[2749]: (process:3129): indicator-application-service-WARNING **: Application already exists, re-requesting properties.
Aug  5 11:45:19 pc-dev systemd[1]: Started Daemon for generating UUIDs.
Aug  5 11:45:28 pc-dev spideroak_inotify[3253]: Program started
Aug  5 11:45:36 pc-dev systemd[1]: Starting Stop ureadahead data collection...
Aug  5 11:45:36 pc-dev systemd[1]: Stopped Read required files in advance.
Aug  5 11:45:36 pc-dev systemd[1]: Started Stop ureadahead data collection.
Aug  5 11:45:40 pc-dev systemd[1]: Started Early root shell on /dev/tty9 FOR DEBUGGING ONLY.
Aug  5 11:45:53 pc-dev systemd[1]: Stopped target Sound Card.
Aug  5 11:45:53 pc-dev systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
Aug  5 11:45:53 pc-dev systemd[1]: Stopped target Timers.
Aug  5 11:45:53 pc-dev systemd[1]: Stopped Daily apt activities.
Aug  5 11:45:53 pc-dev systemd[1]: Stopped Daily Cleanup of Temporary Directories.
Aug  5 11:45:53 pc-dev systemd[1]: Stopped Stop ureadahead data collection 45s after completed startup.
Aug  5 11:45:53 pc-dev systemd[1]: Stopped target Graphical Interface.
Aug  5 11:45:53 pc-dev org.freedesktop.Notifications[2749]: xfce4-notifyd: Fatal IO error 11 (Risorsa temporaneamente non disponibile) on X server :0.
Aug  5 11:45:53 pc-dev systemd[1]: Stopping Light Display Manager...
Aug  5 11:45:53 pc-dev systemd[1]: Stopping Accounts Service...
Aug  5 11:45:53 pc-dev ntfs-3g[3141]: Unmounting /dev/sdc1 (TOSHIBA EXT)
Aug  5 11:45:53 pc-dev systemd[1]: Stopping Disk Manager...
Aug  5 11:45:53 pc-dev ModemManager[2245]: <info>  Caught signal, shutting down...
Aug  5 11:45:53 pc-dev systemd[1]: Stopping Daemon for power management...
Aug  5 11:45:53 pc-dev systemd[1]: Stopped target System Time Synchronized.
Aug  5 11:45:53 pc-dev dbus[2266]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkitd.service'
Aug  5 11:45:53 pc-dev systemd[1]: Stopping User Manager for UID 1000...
Aug  5 11:45:53 pc-dev rsyslogd: [origin software="rsyslogd" swVersion="8.16.0" x-pid="2228" x-info="http://www.rsyslog.com"] exiting on signal 15.
Aug  5 11:48:26 pc-dev rsyslogd: [origin software="rsyslogd" swVersion="8.16.0" x-pid="2232" x-info="http://www.rsyslog.com"] start
Aug  5 11:48:26 pc-dev rsyslogd-2222: command 'KLogPermitNonKernelFacility' is currently not permitted - did you already set it via a RainerScript command (v6+ config)? [v8.16.0 try http://www.rsyslog.com/e/2222 ]
Aug  5 11:48:26 pc-dev rsyslogd: rsyslogd's groupid changed to 108
Aug  5 11:48:26 pc-dev rsyslogd: rsyslogd's userid changed to 104
Aug  5 11:48:26 pc-dev loadkeys[764]: Caricamento di /etc/console-setup/cached.kmap.gz
Aug  5 11:48:26 pc-dev systemd[1]: Started Set console keymap.
Aug  5 11:48:26 pc-dev systemd[1]: Started Create Static Device Nodes in /dev.
Aug  5 11:48:26 pc-dev systemd[1]: Starting udev Kernel Device Manager...
Aug  5 11:48:26 pc-dev systemd[1]: Started Uncomplicated firewall.
Aug  5 11:48:26 pc-dev systemd[1]: Started udev Kernel Device Manager.
Aug  5 11:48:26 pc-dev systemd[1]: Starting Remount Root and Kernel File Systems...
Aug  5 11:48:26 pc-dev systemd[1]: Started Remount Root and Kernel File Systems.
Aug  5 11:48:26 pc-dev systemd[1]: Starting Flush Journal to Persistent Storage...
Aug  5 11:48:26 pc-dev systemd[1]: Reached target Local File Systems (Pre).
Aug  5 11:48:26 pc-dev systemd[1]: Reached target Local File Systems.
Aug  5 11:48:26 pc-dev systemd[1]: Starting Tell Plymouth To Write Out Runtime Data...
Aug  5 11:48:26 pc-dev systemd[1]: Starting LSB: AppArmor initialization...
Aug  5 11:48:26 pc-dev systemd[1]: Starting Set console font and keymap...
Aug  5 11:48:26 pc-dev systemd[1]: Starting udev Coldplug all Devices...
Aug  5 11:48:26 pc-dev systemd[1]: Starting Load/Save Random Seed...
Aug  5 11:48:26 pc-dev systemd[1]: Started Tell Plymouth To Write Out Runtime Data.
Aug  5 11:48:26 pc-dev systemd[1]: Started Load/Save Random Seed.
Aug  5 11:48:26 pc-dev systemd[1]: Started Flush Journal to Persistent Storage.
Aug  5 11:48:26 pc-dev systemd[1]: Starting Create Volatile Files and Directories...
Aug  5 11:48:26 pc-dev systemd-tmpfiles[958]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring.
Aug  5 11:48:26 pc-dev systemd[1]: Started udev Coldplug all Devices.
Aug  5 11:48:26 pc-dev systemd[1]: Starting Show Plymouth Boot Screen...
Aug  5 11:48:26 pc-dev kernel: [    0.000000] Initializing cgroup subsys cpuset
Aug  5 11:48:26 pc-dev apparmor[943]:  * Starting AppArmor profiles
Aug  5 11:48:26 pc-dev kernel: [    0.000000] Initializing cgroup subsys cpu
Aug  5 11:48:26 pc-dev kernel: [    0.000000] Initializing cgroup subsys cpuacct

This is my lshw output

Can someone help me? To me is unbelievable that such a severe bug affects a LTS.

Best Answer

Same problem here on brand new Asus L502S. I tried Mint, Mate, Ubuntu - all the same. Problem is common. I tried everything which can be found regarding this problem over the forums.

Eventually I gave up when I found this: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1594023

Check if you issue is the same and I hope U don't waste another day on this, as I did.