[Pkg-systemd-maintainers] Bug#719945: Bug#719945: systemd: Hangs during shutdown (likely NFS-related)

Michael Stapelberg stapelberg at debian.org
Tue Aug 20 20:03:01 BST 2013


Hi Andreas,

Andreas Kloeckner <inform at tiker.net> writes:
>>> 192.168.1.1:/mnt/main   /mnt/nfs-main           nfs
>>> soft,local_lock=all,timeo=30,vers=3     0 0
>>> 192.168.1.1:/mnt/aux    /mnt/nfs-aux            nfs
>>> soft,local_lock=all,timeo=30,vers=3     0 0
>>
>> Can you mark the fstab entries with the _netdev mount option and try
>> again, please. This should tell systemd to mark the mount point as a
>> remote mount.
>
> Yep, looks like that helped.
I am not yet convinced. The only places where systemd has code that
checks for _netdev, it also checks whether the filesystem type is “nfs”
or something like that:

debian-experimental $ ack -A 5 -B 5 _netdev
src/fstab-generator/fstab-generator.c
185-
186-static bool mount_is_network(struct mntent *me) {
187-        assert(me);
188-
189-        return
190:                hasmntopt(me, "_netdev") ||
191-                fstype_is_network(me->mnt_type);
192-}
193-
194-static bool mount_in_initrd(struct mntent *me) {
195-        assert(me);

src/core/mount.c
307-}
308-
309-static bool mount_is_network(MountParameters *p) {
310-        assert(p);
311-
312:        if (mount_test_option(p->options, "_netdev"))
313-                return true;
314-
315-        if (p->fstype && fstype_is_network(p->fstype))
316-                return true;
317-

debian-experimental $ ack -A 11 fstype_is_network **/*.c

src/shared/util.c
1598:bool fstype_is_network(const char *fstype) {
1599-        static const char table[] =
1600-                "cifs\0"
1601-                "smbfs\0"
1602-                "ncpfs\0"
1603-                "nfs\0"
1604-                "nfs4\0"
1605-                "gfs\0"
1606-                "gfs2\0";
1607-
1608-        return nulstr_contains(table, fstype);
1609-}

In fact, I set up the fstab that you claim to have and ran
/lib/systemd/system-generators/systemd-fstab-generator, then added
_netdev and re-ran it:

$ diff -u NONETDEV-mnt-nfs\\x2dmain.mount mnt-nfs\\x2dmain.mount 
--- NONETDEV-mnt-nfs\x2dmain.mount	2013-08-20 20:55:29.499844228 +0200
+++ mnt-nfs\x2dmain.mount	2013-08-20 21:00:30.182564254 +0200
@@ -16,4 +16,4 @@
 Where=/mnt/nfs-main
 Type=nfs
 FsckPassNo=0
-Options=soft,local_lock=all,timeo=30,vers=3
+Options=soft,local_lock=all,timeo=30,vers=3,_netdev

I think this might either be:

a) coincidence and the issue is not actually fixed
b) a different issue that you fixed by accident by editing fstab
c) an issue in a different program, but not systemd itself

Could you try running systemd-fstab-generator as root? It will store the
units in /tmp. Do the units change if you remove _netdev? Can you
reproduce the problem if you remove _netdev? If so, can you also gzip
your /etc/fstab and attach it please?

Thanks.

-- 
Best regards,
Michael




More information about the Pkg-systemd-maintainers mailing list