i've figured out at least part of this issue.

the system now no longer hangs at shutdown, but there are still
filesystems it complains it is unable to unmount, and the system still
hangs if it unable to unmount /home, which happens to be an nfs share
[i'm uncertain if this is of particular relevance, but it is a
characteristic unique among this system's filesystems].

the root cause was pam_systemd inadvertently excluded from the pam
session config, following customization.  this was causing another
problem [ssh sessions hanging during shutdown instead of being cleanly
terminated], and it was during troubleshooting of the ssh issue when it
hit me that there was a relationship between the two.

during shutdown, systemd brings down the network connection before ssh
processes are gracefully disconnected/terminated.  this leaves the
client unaware, thus the hanging symptom.

additionally, this appears to also leave processes active or files open,
etc., in various locations, and thus affected filesystems are still in
use and cannot be unmounted.  to make matters worse, when the filesystem
in use happens to be an nfs share [in this case,
/home/foo.example.com/], the system hangs at shutdown.

with pam_systemd properly configured in the pam session config, ssh
processes/sessions get to gracefully close, /home/foo.example.com/ and
/tmp/ are cleanly/successfully unmounted, and since the nfs share gets
unmounted, the system does not hang.  however, /var/ and /var/log/ still
fail to be unmounted:

Aug 30 03:27:09 template systemd[1]: Failed unmounting /var/log.
Aug 30 03:27:09 template systemd[1]: Failed unmounting /var.

this is still a problem which shouldn't be happening, but fortunately,
since it's only the nfs unmount fail that makes the system hang, reboots
aren't disastrous.

there are still issues here that need to be addressed:

1] under nominal conditions, filesystems should cleanly unmount.  unmounting 
should not fail.
2] if a filesystem fails to unmount [nfs or otherwise], the system should not 
hang during shutdown.

this can be recreated by doing the following:

• configure the system to mount an nfs share at boot [i used fstab].  it may 
also be enough to just mount an nfs share manually after boot
• disable pam_systemd in the pam session config
• ssh to the computer
• change directory into the nfs share, so the filesystem is in use
• reboot

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1709384

Title:
  failed to unmount filesystems during shutdown, reboot hangs

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1709384/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to