I've now tried a version of nfs-common and rpcbind with systemd units similar to those that Matthew Grant attached to bugs #622394 and #748074. See attached for the patches I used.
The short version is that I don't think those systemd units are either necessary or sufficient to fix the various issues reported in later mails to #622394; but if they're advantageous for whatever reason, I would suggest using my adjusted versions. (Riku: sorry, I did this rpcbind patch independently before seeing the one you attached to #748074. I think mine is a small improvement over yours, but I also think it might be a red herring in terms of solving this bug.) On 07/11/14 20:23, Simon McVittie wrote: > Bug M1, reported by Matthew Grant, present in 1:1.2.8-6: "NFS mounts > from /etc/fstab do not work". (What symptoms? What error messages?) This > one might be related to NFS entries in /etc/fstab that don't have _netdev. The symptom that *I* get on some boots is these messages in the NFS client's Journal/syslog (my test-case for NFS is mounting one machine's /srv onto the other machine's /srv): mount[309]: mount.nfs: Network is unreachable systemd[1]: srv.mount mount process exited, code=exited status=32 systemd[1]: Failed to mount /srv. systemd[1]: Dependency failed for Remote File Systems. systemd[1]: Unit srv.mount entered failed state. ... because systemd tries to mount /srv shortly before the DHCP client comes up, which isn't going to work well. Does that resemble what you get? The patched packages do not improve this; neither do they make it worse. systemd is meant to recognise network mounts in fstab automatically (it knows about cifs, smbfs, sshfs, ncpfs, ncp, nfs, nfs4, gfs, gfs2, glusterfs) so it should't be necessary to have _netdev in the options field, but perhaps that isn't working correctly for whatever reason? Or perhaps waiting for network-online.target is not necessarily sufficient with some network connectivity setups? (My test systems are using ifupdown and DHCP, not NetworkManager or systemd-networkd or anything.) > Bug M2, reported by Matthew Grant, present in 1:1.2.8-6: "NFS exports > also fail due to rpcbind not starting before nfs-common and nfs- > kernel-server". I have not been able to reproduce this, with or without native systemd units. One possible reason why this could happen sometimes is that /etc/init.d/rpcbind has "Provides: rpcbind", which seems ... redundant. I would expect it to have "Provides: $portmap" in order to be ordered before nfs-common, which has "Required-Start: $portmap". If that is in error, cloning an rpcbind bug would seem appropriate. > Bug C1, sort-of-reported by Chris Butler, present in 1:1.2.8-9: "the > boot order problem on NFS clients that mount remote filesystems on > boot". This might be the same thing as M1. (Do you have _netdev in the > options of the relevant mounts?) It isn't completely clear to me what boot order problem this refers to, so I can't say whether I can reproduce it. > Bug C2, reported by Chris Butler, present in 1:1.2.8-9 with Matthew's > systemd units added: 'tries to start "statd" before "rpcbind"'. I > believe this is an omission in one of Matthew's systemd units, and I am > about to test a version of nfs-common that should fix that bit. I think this is the missing line, to be added to the Unit section: After=rpcbind.service time-sync.target (only rpcbind.service is directly relevant here, but it seems better to be correct) If I'm correct about that, then this part is a regression caused by Matthew's systemd units, and not a bug in the nfs-common package that currently exists in Debian. S
diff -Nru nfs-utils-1.2.8/debian/control nfs-utils-1.2.8/debian/control --- nfs-utils-1.2.8/debian/control 2014-08-13 01:12:43.000000000 +0100 +++ nfs-utils-1.2.8/debian/control 2014-11-07 10:45:39.000000000 +0000 @@ -3,7 +3,7 @@ Section: net Maintainer: Debian kernel team <debian-kernel@lists.debian.org> Uploaders: Anibal Monsalve Salazar <ani...@debian.org>, Ben Hutchings <b...@decadent.org.uk>, Steve Langasek <vor...@debian.org> -Build-Depends: debhelper (>= 7), libwrap0-dev, libevent-dev, libnfsidmap-dev (>= 0.24), libkrb5-dev, libblkid-dev, libkeyutils-dev, pkg-config, libldap2-dev, libcap-dev, libtirpc-dev (>= 0.2.4-2~), libdevmapper-dev, dh-autoreconf, libmount-dev, libsqlite3-dev +Build-Depends: debhelper (>= 7), libwrap0-dev, libevent-dev, libnfsidmap-dev (>= 0.24), libkrb5-dev, libblkid-dev, libkeyutils-dev, pkg-config, libldap2-dev, libcap-dev, libtirpc-dev (>= 0.2.4-2~), libdevmapper-dev, dh-autoreconf, libmount-dev, libsqlite3-dev, dh-systemd Standards-Version: 3.9.0 Homepage: http://nfs.sourceforge.net/ Vcs-Git: git://git.debian.org/kernel/nfs-utils.git diff -Nru nfs-utils-1.2.8/debian/nfs-common.service nfs-utils-1.2.8/debian/nfs-common.service --- nfs-utils-1.2.8/debian/nfs-common.service 1970-01-01 01:00:00.000000000 +0100 +++ nfs-utils-1.2.8/debian/nfs-common.service 2014-11-07 10:40:16.000000000 +0000 @@ -0,0 +1,14 @@ +[Unit] +Description=NFS Common daemons +Wants=remote-fs-pre.target +After=rpcbind.service time-sync.target +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/etc/init.d/nfs-common start +ExecStop=/etc/init.d/nfs-common stop + +[Install] +WantedBy=sysinit.target diff -Nru nfs-utils-1.2.8/debian/rules nfs-utils-1.2.8/debian/rules --- nfs-utils-1.2.8/debian/rules 2014-08-13 01:12:43.000000000 +0100 +++ nfs-utils-1.2.8/debian/rules 2014-11-07 10:43:53.000000000 +0000 @@ -54,7 +54,9 @@ dh_install -Xman --fail-missing dh_installdocs -A dh_installdocs -pnfs-common debian/README.Debian.nfsv4 + dh_systemd_enable -pnfs-common dh_installinit -pnfs-common -R + dh_systemd_start -pnfs-common install -m 0755 debian/nfs-kernel-server.init debian/nfs-kernel-server/etc/init.d/nfs-kernel-server install -m 0644 debian/nfs-common.bugcontrol debian/nfs-common/usr/share/bug/nfs-common/control install -m 0755 debian/nfs-common.bugscript debian/nfs-common/usr/share/bug/nfs-common/script
diff -Nru rpcbind-0.2.1/debian/control rpcbind-0.2.1/debian/control --- rpcbind-0.2.1/debian/control 2014-08-18 10:37:52.000000000 +0100 +++ rpcbind-0.2.1/debian/control 2014-11-07 10:51:27.000000000 +0000 @@ -2,7 +2,7 @@ Section: net Priority: standard Maintainer: Anibal Monsalve Salazar <ani...@debian.org> -Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), autotools-dev, pkg-config, libtirpc-dev (>= 0.2.4-2~), libwrap0-dev +Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), autotools-dev, pkg-config, libtirpc-dev (>= 0.2.4-2~), libwrap0-dev, dh-systemd Standards-Version: 3.9.5 Homepage: http://sourceforge.net/projects/rpcbind/ diff -Nru rpcbind-0.2.1/debian/rpcbind.service rpcbind-0.2.1/debian/rpcbind.service --- rpcbind-0.2.1/debian/rpcbind.service 1970-01-01 01:00:00.000000000 +0100 +++ rpcbind-0.2.1/debian/rpcbind.service 2014-11-07 10:32:08.000000000 +0000 @@ -0,0 +1,19 @@ +[Unit] +Description=RPC bind portmap service +After=systemd-tmpfiles-setup.service +Wants=remote-fs-pre.target +Before=remote-fs-pre.target +DefaultDependencies=no + +[Service] +Environment="OPTIONS=-w" +ExecStart=/sbin/rpcbind $OPTIONS +EnvironmentFile=-/etc/rpcbind.conf +EnvironmentFile=-/etc/default/rpcbind +Type=forking +KillMode=process +Restart=on-failure + +[Install] +WantedBy=sysinit.target +Alias=portmap diff -Nru rpcbind-0.2.1/debian/rpcbind.tmpfile rpcbind-0.2.1/debian/rpcbind.tmpfile --- rpcbind-0.2.1/debian/rpcbind.tmpfile 1970-01-01 01:00:00.000000000 +0100 +++ rpcbind-0.2.1/debian/rpcbind.tmpfile 2014-11-07 10:24:01.000000000 +0000 @@ -0,0 +1,4 @@ +#Type Path Mode UID GID Age Arguments +d /run/rpcbind 0755 root root - - +f /run/rpcbind/rpcbind.xdr 0600 root root - - +f /run/rpcbind/portmap.xdr 0600 root root - - diff -Nru rpcbind-0.2.1/debian/rules rpcbind-0.2.1/debian/rules --- rpcbind-0.2.1/debian/rules 2014-01-01 00:52:02.000000000 +0000 +++ rpcbind-0.2.1/debian/rules 2014-11-07 10:46:51.000000000 +0000 @@ -72,9 +72,11 @@ dh_installdocs dh_installexamples dh_installman man/rpcinfo.7 + dh_systemd_enable dh_installinit --no-start --name rpcbind-boot dh_installinit --no-start --name portmap-wait dh_installinit + dh_systemd_start dh_link dh_strip dh_compress