[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: auto-mount NFS shares on boot



Hi,

Am 2015-06-28 12:54, schrieb Michael Biebl:
I suggest to add this simple fix to Jessie by uploading it to
stable-proposed-updates. What do you think? Also, do you think that
/etc/systemd/system/remote-fs-pre.target.d/nfs.conf belongs to systemd package or to nfs-common? I would say it belongs to nfs-common as that
one provides the required tools and services to mount NFS shares on a
client.

For Jessie:

 - nfs-common is still an init script, so one cannot simply add
   Before=remote-fs-pre.target to that. But there are two other
   options:

 - just for Jessie: update systemd to change the original unit file
   remote-fs-pre.target to include After=nfs-common.service

 - or alternatively, package a drop-in in /lib in the nfs-common
   package, i.e.
   /lib/systemd/system/nfs-common.service.d/systemd-ordering.conf:
   [Unit]
   Before=remote-fs-pre.target

(IMHO at least, I'll defer to the maintainers of the respective
packages as to what they think is appropriate.)

Certainly, the preferred fix is, that packages ship native service files
which override/replace the sysv init scripts.
In case of nfs-common/rpcbind, Ubuntu has done some extensive work to
properly integrate nfs-common/rpcbind with systemd.

This hasn't landed in Debian (yet) and is not something which can be
backported for jessie.

The drop-in snippet for nfs-common to augment the dependency information when being run under systemd is something which seems to be suitable for
jessie and could be added to the package in sid to give it some testing
first. Ideally, that drop-in is shipped by the package itself. This
would mean a stable upload for nfs-common.

I prepared a patch for nfs-utils 1.2.8-9 that adds a systemd drop-in for
nfs-common at /lib/systemd/system/nfs-common.service.d/remote-fs-pre.conf.
It places the nfs-common service before the remote-fs-pre target. This
results in the rpc.gssd service beeing started before NFS shares are
mounted during the boot process.

The patch is tested on my system and works for me. I suggest to upload
nfs packages with this patch to Jessie (through stable-proposed-updates)
in order to fix auto-mounting Kerberos-secured NFS mounts at boot in
Jessie.

Do nfs-utils maintainers take care of this upload? Otherwise I can do
the upload (and ask RMs for approval first) myself. A short comment
would be helpful.

Cheers,
 jonas
diff -Nru nfs-utils-1.2.8/debian/changelog nfs-utils-1.2.8/debian/changelog
--- nfs-utils-1.2.8/debian/changelog	2014-08-13 02:12:43.000000000 +0200
+++ nfs-utils-1.2.8/debian/changelog	2015-07-07 12:11:02.000000000 +0200
@@ -1,3 +1,13 @@
+nfs-utils (1:1.2.8-9+deb8u1) jessie; urgency=medium
+
+  * NMU by Jonas Meurer.
+  * Add a systemd drop-in to fix boot order for NFSv4+Kerberos setups.
+    rpc.gssd needs to be started before mounting Kerberos-secured NFS
+    mounts. The drop-in takes care that NFS common services are started
+    before systemd target remote-fs-pre is reached. Closes: #775542.
+
+ -- Jonas Meurer <jonas@freesources.org>  Tue, 07 Jul 2015 12:04:45 +0200
+
 nfs-utils (1:1.2.8-9) unstable; urgency=medium
 
   * debian/patches/22-mountd-fix-segfault-in-add_name-with-newer-gcc-
diff -Nru nfs-utils-1.2.8/debian/nfs-common.dirs nfs-utils-1.2.8/debian/nfs-common.dirs
--- nfs-utils-1.2.8/debian/nfs-common.dirs	2014-08-13 02:12:43.000000000 +0200
+++ nfs-utils-1.2.8/debian/nfs-common.dirs	2015-07-07 12:04:37.000000000 +0200
@@ -7,3 +7,4 @@
 usr/share/nfs-common/conffiles
 usr/share/bug/nfs-common
 usr/share/bug/nfs-utils
+lib/systemd/system/nfs-common.service.d
diff -Nru nfs-utils-1.2.8/debian/nfs-common.install nfs-utils-1.2.8/debian/nfs-common.install
--- nfs-utils-1.2.8/debian/nfs-common.install	2014-08-13 02:12:43.000000000 +0200
+++ nfs-utils-1.2.8/debian/nfs-common.install	2015-07-07 12:04:24.000000000 +0200
@@ -22,3 +22,4 @@
 debian/idmapd.conf usr/share/nfs-common/conffiles/
 debian/nfs-common.default usr/share/nfs-common/conffiles/
 debian/id_resolver.conf etc/request-key.d/
+debian/systemd-remote-fs-pre.conf lib/systemd/system/nfs-common.service.d/remote-fs-pre.conf
diff -Nru nfs-utils-1.2.8/debian/systemd-remote-fs-pre.conf nfs-utils-1.2.8/debian/systemd-remote-fs-pre.conf
--- nfs-utils-1.2.8/debian/systemd-remote-fs-pre.conf	1970-01-01 01:00:00.000000000 +0100
+++ nfs-utils-1.2.8/debian/systemd-remote-fs-pre.conf	2015-07-07 12:37:40.000000000 +0200
@@ -0,0 +1,2 @@
+[Unit]
+Before=remote-fs-pre.target

Reply to: