14 Apr 2008

Fix slow Ubuntu shutdown with CIFS (SMBFS)

My Ubuntu machine at home always takes a bazillion years to turn off. I've been seeing this "Server not responding" error forever, but I've just ignored it. An explanation from the article "Five things to do on a freshly installed Ubuntu":

CIFS: Unmount CIFS shares before shutting down the network

There is a very nasty bug in Ubuntu, which occurs, if you use NetworkManager and have any active CIFS share while shutting down your system. If you do that, you'll experience a timeout while shutting down, lengthening it by ~30 seconds per share. You'll also get the message CIFS VFS: Server not responding.

There is a bug entry on launchpad, but it is not yet fixed. Fortunately, there is an easy workaround.

Here are my simplified instructions:
cd /etc/init.d
sudo wget http://www.jejik.com/files/examples/umountcifs
sudo chmod ugo+x umountcifs
sudo update-rc.d umountcifs stop 02 0 6 .
That ought to take care of it.

6 comments:

yorak said...

This solved it! Thanks, now my mythtv box shuts down without idling forever.

Goldy said...

Thanks for this. This seems to have solved the problem for my eee with Ubuntu on shutdown. I still get this when I do a suspend however. I suspect that the fix only runs on shutdown, but I don't know enough about Linux/Ubuntu to activate it for suspend, and I imagine that I could really screw things up. Any ideas? Thanks.

Gondrup said...

Thank you so much for this tip, my HTPC no longer hangs while trying to shut down :).

SUroot said...

Fantastic, thank you. 11.04 now shuts down in 10 seconds

Anonymous said...

Nearly 5 years later, and I still found your solution useful. I did make a minor modification--I added wicd to the "# Required-Stop:" comment header to force update-rc.d to shut down wicd after this ran. If one uses Network Manager, one could do the same thing by adding network-manager to the same comment header.

Anyway, this got rid of the insane 5-minute timeout that occurred every time I shut down or rebooted Debian Wheezy. Thank-you.

NDDR89 said...

It's 2016, Ubuntu 14.04 LTS and I still find it useful. Thank you so, so much.