Bug 59152 - CIFS mount hangs on shutdown/restart
Summary: CIFS mount hangs on shutdown/restart
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-09 04:49 UTC by jree2kx
Modified: 2013-10-10 16:05 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description jree2kx 2013-01-09 04:49:42 UTC
If I have a CIFS mount in my fstab it mounts fine after boot, but when I shutdown or restart the system hangs for a few minutes. It appears systemd isn't unmounting the the network share prior to disconnecting the network, which causes the hang. The only workaround I have is to manually unmount the share first. I have searched all over the internet and Arch Forums to find a solution for this annoying bug. The only thing left to try is creating a rc.local.shutdown.service as someone recommended. I feel like that's a hacky solution. Here is the entry in my fstab:

//10.10.0.10/Music  /mnt/Music  cifs uid=j_r0dd,credentials=/etc/smb.auth,x-systemd.automount  0 0
Comment 1 Lennart Poettering 2013-01-14 22:34:17 UTC
Hmm, if you drop the automount bit for it, does it work correctly then?
Comment 2 jree2kx 2013-01-14 22:56:23 UTC
No. Same thing. I tried autofs and the same issue. I just switched to KDE and there is an option to run shutdown scripts. I added one to run "sudo umount -t cifs -a -f -l" and added myself to sudoers to execute umount without a password which does the trick for me. I'm not sure if the behavior is the same for NFS shares because I have none set up to test. The shares are being mounted after there is a network connection so it would make sense on shutdown to do the reverse and unmount them before the network service is shutdown.
Comment 3 Lennart Poettering 2013-02-04 21:00:08 UTC
Hmm, I wonder if 0c08f5cde749bd2818475e487109cd0d413452df fixes things for you? Could you test?
Comment 4 jree2kx 2013-03-18 00:02:02 UTC
Sorry, I somehow missed the email notification. If that patch is in 198, the issue is still there.
Comment 5 jree2kx 2013-05-13 00:16:21 UTC
I just switched to NFS and I do not have this issue anymore.
Comment 6 Mickaël Thomas 2013-06-16 19:42:12 UTC
I'm also having this issue.

https://www.samba.org/samba/docs/man/manpages-3/umount.cifs.8.html specifies that the -f option can be passed to umount.

Strangely enough, with -f the unmount process still seems to be blocking (even though the device is unmounted instantly).
Comment 7 Larry Johnson 2013-09-26 21:46:59 UTC
I'm having the hanging issue with systemd 207-5 and 3.11.1-2-ARCH x86_64.

System crashes (become unresonsive requires hard reset) when shutdown or restarted.

On restart the boot partition require fsck do to improper closure.

Stopping requires unount /dev/sdf1 ; sync ; poweroff -f

No such problem with i686 laptop.
Comment 8 Zbigniew Jedrzejewski-Szmek 2013-10-05 19:01:46 UTC
(In reply to comment #2)
>> Hmm, if you drop the automount bit for it, does it work correctly then?
> No. Same thing. I tried autofs and the same issue.
Just to verify, does it also hang if automount is not used at all?
Comment 9 Zbigniew Jedrzejewski-Szmek 2013-10-10 16:05:58 UTC
systemd side of the problem should be fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=7700945. The issue that cifs mount cannot be forcibly unmounted probably remains. Feel free to take it up with fuse people or kernel people.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.