120sec delay during shutdown or reboot with still mounted cifs (via Wifi)

Bug #1577885 reported by Matthias Laumer on 2016-05-03
126
This bug affects 25 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Undecided
Unassigned
systemd (Ubuntu)
Undecided
Unassigned

Bug Description

Using Ubuntu 16.04 Desktop with Unity, used the same approach in 14.04 with no issue.

I prepare for mounting with the following entry in /etc/fstab my Synology NAS :

//192.168.178.61/data /media/server/server_data cifs users,uid=1000,gid=1000,username=xxxxx,passwd=xxxxxx,iocharset=utf8,sec=ntlm,noauto,_netdev 0

After login to unity, I mount it with a bash-script (mount -a) which is called from ~/.config/autostart/myMounts.desktop

Doing this, and shuting down or rebooting lead into a very delayed shutdown (round about 2 minutes) Pressing ESC Key, showed that the process stops at the command "umount /media/server ..."

I have not tested if this also occurs when I am connected via ethernet. I think it is because the (Wifi)Network is already disabled prior all umounts are done.

This issue happens even if I type in a shutdown command into a Terminal or if I choose shutdown form the menue, also if I use the power-button.

Failure can be avoided if I umount the network-drives manually previouse to reboot.

Interim solution was, to create an alias for "shutdown" like "sh /path/to/umount/script.sh && shutdown" in /etc/bash.bashrc.local.

description: updated
description: updated
description: updated

Just installed an automated update to Kernel 4.4.0-22-generic. Now, the workarround with the "aliases" has also stopped working.

Unable to shutdown Ubuntu with mounted CIFS (only after 120 sec. of trying and finnaly failing...)

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed

This bug seems to be quite similar to "[Bug 211631] Network is brought down before network filesystems are unmounted (CIFS timeout at shutdown)", fixed in 2013. Has Xenial brought back an old problem?

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed

In https://wiki.archlinux.org/index.php/talk:NFS#NetworkManager-wait-online I found a workaround that works for me (ArchLinux has been using systemd for a long time already):

 * create a file /lib/systemd/system/auto_share.service with the following contents:
     After=NetworkManager-wait-online.service
     Before=systemd-user-sessions.service

 * execute the following commands in a terminal:
     systemctl enable NetworkManager-wait-online
     systemctl reenable auto_share.service

Having done this once, booting and shutdown works fine, even with still mounted cifs shares. It stays the same after system reboot.

Even if this workaround will work fine for everyone (?), this bug should be fixed permanently anyhow!

Ilya Ryabinin (riv1329) wrote :

#5 workaround does not work for me. I not use networkmanager, just /etc/network/interfaces

Anatoli (anatoli) wrote :

Same problem here with davfs2 mount. davfs2 tries to gracefully close the mount, but the connection (WiFi + OpenVPN) is turned off without waiting for unmount. The share is mounted with _netdev option.

The problem happens only on shutdown. On reboot everything works fine. Don't know what's the difference.

MBWD (xmbwd) wrote :

Just confirming the bug. Running Ubuntu 16.04 and a cifs mount that is mounted via /etc/fstab. Delay is on shutdown. Takes about 3-4 minutes.

Anatoli (anatoli) wrote :

Maintainers, please set a priority (severe IMO) and assign this bug to someone, it's extremely annoying to wait up to 5 minutes for the computer to shutdown and get some errors during the process.

Network-manager should have some mechanism to instruct it not to shutdown the network before some signal or other indication. It can't just cut the network when other processes are using it. Maybe an order of shutdown could be defined via systemd.

MBWD (xmbwd) wrote :

Posting again to confirm that this bug exists in Ubuntu GNOME 17.04 and 17.10.

Frederick Zhang (frederick888) wrote :

Sorry to jump in out of the blue, but may I know whether there are any updates to this issue?

Rahn Stavar (rahnstavar) wrote :

So after trying seemingly everything,I realised I hadn’t allowed all users to use my wifi connection. There’s a tick box in network manager for this. This may sound very basic but I completely overlooked it to begin with. After that it solved the problem.

Frederick Zhang (frederick888) wrote :

Ahhhh, yup! That's the missing piece of the puzzle! I once had it ticked because of the bug of plasma-nm and totally forgot that I later turned it off. Thank you, Rahn!

tags: added: rls-bb-incoming
Sebastien Bacher (seb128) wrote :

Would be nice to investigate/sort out but not's a release blocker, tagging rls-bb-notfixing

tags: added: rls-bb-notfixing
removed: rls-bb-incoming
jayshomebrew (jayshomebrew) wrote :

Confirmed bug with:
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

Thanks to Rahn Stavar (rahnstavar) to showing us an easy fix.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers