How to fix: ubuntu 16.04 hangs (or very slow) on shutdown (or on reboot). Also fix persistent journald
If you are experiencing problems during reboot/shutdown then most probably you have CUPSD installed or you have custom DE. If you also can't read journald logs of previous boots then most probably you have separate partition for
/var
.
- To fix persistent journal: add option
auto
to mount options of/var
. Example:
/dev/sdb2 /var ext4 defaults,
auto
, noatime 0 2
Why problem happend:
systemd-journal-flush.service
starts beforevar.mount
(you can check this with (systemd-journal-flush.service
) - When you have fixed logging problems you can now check what processes are causing problems during reboot:
Examine event timing of stopped processes and you will get insight on what's causing problems during rebootsudo journalctl -b-1 | grep 'Stopped'
- If you have problems with CUPSD then you can try disabling Browsing for cups:
In file
/etc/cups/cupsd.conf
disable browsing and protocols:
In fileBrowsing Off BrowseLocalProtocols none
/etc/cups/cups-browsed.conf
disable all protocols:BrowseRemoteProtocols none
-
If yoyu still have problems then
delete systemdtune shutdown/reboot settings:- Kill stale processes faster. To do this edit file
/etc/systemd/system.conf
:[Manager] DefaultTimeoutStopSec=5s
- Autokill user processes when user exits (not good for tmux and similar software). To do this edit file
/etc/systemd/user.conf
:[Manager] KillUserProcesses=Yes
- Kill stale processes faster. To do this edit file