Tuesday, November 24, 2015

Slow shutdown/reboot when mounting CIFS/SMB shares on Ubuntu and derivatives

My laptop with Linux Mint 17.2 suddenly started taking full minutes for every reboot/shutdown. What might have caused it?

I then remembered I had previously placed some new entries in the fstab, since I needed to mount some remote CIFS shares. Could this be the culprit?

Well, it seems it was exactly that: there is a bug in Network Manager which shuts down before unmounting the network shares. This will cause CIFS to hang and wait for 60 seconds or so for every share.

Even though the Ubuntu Wiki says that this bug has been solved since version 12.04, I have applied the suggested solution and it worked.
Now the shutdowns/reboots happen in an instant!

So, is the bug back? I don't know, but what I know is that this is how to fix this problem:
sudo ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K14umountnfs.sh
sudo ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K14umountnfs.sh

1 comment:

  1. While the above didn't fix my slow shutdown, this is the top result for me in Google. Here is the fix that solved my issue

    In network manager set connection to allow all users to use. Made my shutdowns sub 10 seconds

    ReplyDelete