Slow reboot, pretty sure it's caused by failing to unmount /tmp.

So when I reboot, my computer (openSUSE 13.2) shows a black screen for about a minute or two before finally getting to the BIOS (I assume shutdown takes just as long, but the problem is much more obvious during reboot). I decided to try and track it down, and I’ve located these lines in the systemd journal output:

May 21 19:25:13 umount[27305]: umount: /var/log: target is busy
May 21 19:25:13 umount[27305]: (In some cases useful info about processes that
May 21 19:25:13 umount[27305]: use the device is found by lsof(8) or fuser(1).)
May 21 19:25:13 umount[27312]: umount: /tmp: target is busy
May 21 19:25:13 umount[27312]: (In some cases useful info about processes that
May 21 19:25:13 umount[27312]: use the device is found by lsof(8) or fuser(1).)
May 21 19:25:13 systemd[1]: Failed unmounting /tmp.

(the more recent journal entries are for some reason inaccessible, but that’s a separate issue as I believe this still represents the cause of the slow reboot)

As you can see, /tmp fails to unmount, and this is just before the “-- Reboot --” line, so I know that it’s part of the shutdown process. Some additional information:

  1. Running lsof shows the usual suspects (PulseAudio, Firefox, GNOME Shell, Dropbox, Bluetooth, and my terminal) are using it, but that’s no surprise, and fuser doesn’t list anything.
  2. The relevant fstab line is UUID=87464014-c492-4968-a41c-1038739b9d0b /tmp btrfs subvol=tmp 0 0.
  3. My home directory is encrypted, and based on some of my searches, encrypting the disk has caused unmounting issues elsewhere, but I don’t believe that /tmp is included, so I don’t know if it’s relevant.

Any suggestions on how to find out what’s causing /tmp to stay busy and not unmount properly?

For me it is a surprise. I would think that when you shut down, the first thing that is done is logoff of the users.

But maybe I do not complete understand what happens, because you say “when I reboot”, but you do not explain what exactly you do. I am a KDE user and normaly when I reboot (very seldom), I click the corresponding icon on the desktop, which will then first log me out and then start the reboot. Is Gnome different? Are you doing different?

And of course it when a process still uses /tmp (having a file open there or “being there” as working directory), umount will fail, regardless if such a process is a usual suspect or not.

That lsof output is during normal desktop usage, so those services aren’t necessarily still running during shutdown. Unfortunately I don’t know how to call lsof at the exact moment that /tmp is being unmounted, but everything listed there is pretty standard and widely-used, so I’d be surprised if one of them was the culprit.