Slow closing network connections on shutdown

When trying to shutdown my computer, closing mapped cifs network connections (connected using fstab on boot) takes an extended time (90secs+).
If I unmount manually, as root, in a console, happens immediately.
Thoughts?

Network is shutdown before CIFS filesystems are unmounted.

Are you using NetworkManager or wicked? Wired/wireless network connection? Can you show your working /etc/fstab configuration?

Using Wicked (default), wireless, fstab:

UUID=a9a4c710-8565-4dba-b250-4c6631d31d48  /                ext4  acl,user_xattr               0  1
UUID=75C31A332F906D63                      /mounts/data     ntfs  defaults,locale=en_US.UTF-8                     0  0
UUID=461EE67D1EE66601                      /mounts/Windows  ntfs  defaults,locale=en_US.UTF-8                     0  0
UUID=D8CEC6B7CEC68D66                      /mounts/Music    ntfs  defaults,locale=en_US.UTF-8                     0  0
UUID=36ecf78e-89c1-479a-a3fa-e41ee8458dca  /home            ext3  data=ordered,acl,user_xattr  0  2
UUID=FC1624D9162496A4                       /home/MyData/bigun   ntfs-3g    defaults,locale=en_US.UTF-8 0 0
UUID=d25c8f42-7667-4122-ae82-62a72b817df2 /home/MyMedia/Overflo ext3       defaults              1 2
UUID=208E06AC8E067B14                       /home/MyMedia/Movies ntfs-3g    defaults,locale=en_US.UTF-8 0 0
UUID=e41f7d0c-ab70-4d51-8636-435836e76df3 /home/MyData/Backup  ext4       defaults              1 2
//192.168.0.2/data    /home/External/data    cifs username=john,password=******,iocharset=utf8,sec=ntlm  0  0
//192.168.0.2/Music    /home/External/Music    cifs    username=john,password=******,iocharset=utf8,sec=ntlm    0    0
//192.168.0.2/extra/    /home/External/Extra    cifs    username=john,password=******,iocharset=utf8,sec=ntlm    0    0
//192.168.0.2/Download/    /home/External/Download    cifs    username=john,password=******,iocharset=utf8,sec=ntlm    0    0

I’ve read of one suggestion with respect wireless connections that might help here.

It required the use of a modified unit file…

cp /usr/lib/systemd/system/wpa_supplicant.service /etc/systemd/system/
nano /etc/systemd/system/wpa_supplicant.service

and modified with the following (so that wpa_suuplicant will stay active until remote shares are unmounted)…

Before=remote-fs.target network.target

Save when done, and then do

systemctl daemon-reload
systemctl restart wpa_supplicant.service

See how that goes.

Another workaround might be to use auto-mounting instead, with an idle timeout of 30 seconds. For example…

//192.168.0.2/data    /home/External/data    cifs noauto,x-systemd.automount,x-systemd.idle-timeout=30 username=john,password=******,iocharset=utf8,sec=ntlm  0  0

Hopefully, this means that when you shutdown your computer, such remote cifs shares are unmounted already.