Comment 88 for bug 211631

Revision history for this message
Thierry Carrez (ttx) wrote : Re: CIFS/SMBFS shares not unmounted before network is shut down

I think I also need to clarify something here.

If you use NetworkManager with per-user settings (i.e. without the "system setting" checkbox checked) then the network connection is up only during your session. When you log out from your Gnome session, the network connection goes down. This is the default for desktops, and usually the case for wireless connections where the password is stored in the user keyring.

So the whole concept of mounting any network filesystem system-wide at boot (in /etc/fstab) while your network will only be there during your Gnome session is flawed.

Here are the sane modes of operation:
(1) Not using NetworkManager, define a static network configuration in /etc/network/interfaces
Then you can use /etc/fstab without any problem, shutdown will work without a timeout. This is usually used on servers.

(2) Using NetworkManager in "system setting" mode
Then you should be able to use /etc/fstab without a problem. At this point there is a bug in NetworkManager that makes it die before umountnfs is called. The version in my PPA solves this. Please test.

(3) Using NetworkManager without "system setting" checked (per-session mode)
Then you shouldn't be using /etc/fstab at all. The network will go down when the Gnome session stops. True network filesystem mounts require the network to be up regardless of the Gnome session status. You should use nautilus mounts instead (smb://server/share). Those will be unmounted before Gnome logout.

I am trying to solve the bug in the (2) case here.
If you are in the (3) case (and a lot of you probably are) you should either switch to "system setting" mode or drop usage of CIFS mounts in favor of Nautilus gvfs-smb mounts.