The systemd facility changes sysvinit behavior considerably, especially sending no SIGKILL after SIGTERM.
Suggested solution, send SIGKILL after timeout, following SIGTERM. ________ Primary difference is systemd defers forever to underlying processes, rather than shooting them in the head eventually. This means processes which trap SIGTERM + never end, hang system shutdown. https://bugs.launchpad.net/ubuntu/+source/mysql-5.6/+bug/1468804 describes this problem with MySQL, not MariaDB, which does a very fast shutdown. Another culprit is fail2ban, which takes far to long to shutdown. I'll push a shutdown fix for fail2ban shortly. Worst offenders are /etc/rc.local processes, especially where a supervisor program runs children + one or more children fail to die or the supervisor restarts them when they die. Issuing - systemctl --no- pager status rc.local.service - in a shell while issuing reboot in another shell shows this problem. The easiest way to debug a reboot hang is to run two shells + do reboot in one. Then a few seconds later issue - systemctl --no-pager status - in the surviving shell. A quick scan of this output usually surfaces the culprit. Starting the attached script in /etc/rc.local as follows... looper > /var/log/looper.log 2>&1 show systemd sends SIGTERM + never follows up with a SIGKILL, at least within 5 minutes, which is when I killed the process myself to allow reboot to finish shutdown + do restart. net4-dev# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 15.10 Release: 15.10 Codename: wily net4-dev# uname -a Linux net4.bizcooker.com 4.2.0-22-generic #27-Ubuntu SMP Thu Dec 17 22:57:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux ** Attachment added: "looper" https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1528655/+attachment/4539392/+files/looper -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1528655 Title: Wily/15.10 - systemd hangs reboot + shutdown for long periods of time To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1528655/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs