File 0001-systemd-manually-insert-auth_rpcgss-module.patch of Package nfs-utils.3350

From 2d9ea45bdbaf8bd78ce34b99480df548d367082d Mon Sep 17 00:00:00 2001
From: "J. Bruce Fields" <>
Date: Wed, 24 Sep 2014 11:26:12 -0400
Subject: [PATCH] systemd: manually insert auth_rpcgss module.

We need to insert the auth_rpcgss module before starting rpc.svcgssd or
gss-proxy, for two reasons:

    - gss-proxy needs access to the /proc/net/rpc/use-gss-proxy file
      to set up communication with knfsd.
    - the unit files need to able to test for the existance of the
      same path in order to decide whether the kernel supports
      gss-proxy or not.

Currently we're using dependencies on proc-fs-nfsd.mount for this, but
that works only because of the nfsd kernel module references some
symbols in auth_rpcgss, which is an odd implementation detail we're
likely to fix some day.

Signed-off-by: J. Bruce Fields <>
Signed-off-by: Steve Dickson <>
 systemd/auth-rpcgss-module.service | 14 ++++++++++++++
 systemd/          |  2 +-
 systemd/nfs-server.service         |  1 +
 3 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 systemd/auth-rpcgss-module.service

diff --git a/systemd/auth-rpcgss-module.service b/systemd/auth-rpcgss-module.service
new file mode 100644
index 000000000000..3fc2f4ac924f
--- /dev/null
+++ b/systemd/auth-rpcgss-module.service
@@ -0,0 +1,14 @@
+# We want to start gss-proxy on kernels that support it and rpc.svcgssd
+# on those that don't.  Those services check for support by checking
+# for existence of the path /proc/net/rpc/use-gss-proxy.  Before they
+# can perform that check, they need this module loaded.  (Unless
+# rpcsec_gss support is built directly into the kernel, in which case this
+# unit will fail.  But that's OK.)
+Description=Kernel Module supporting RPCSEC_GSS
+Before=gssproxy.service rpc-svcgssd.service
+ExecStart=/sbin/modprobe -q auth_rpcgss
diff --git a/systemd/ b/systemd/
index f3c09e76a0f7..474f5e9ad74b 100644
--- a/systemd/
+++ b/systemd/
@@ -5,7 +5,7 @@
 # Note: we don't "Wants=rpc-statd.service" as "mount.nfs" will arrange to
 # start that on demand if needed.
-Wants=rpc-gssd.service rpc-svcgssd.service
+Wants=rpc-gssd.service rpc-svcgssd.service auth-rpcgss-module.service
 Wants=nfs-blkmap.service rpc-statd-notify.service
 Before=rpc-gssd.service rpc-svcgssd.service nfs-blkmap.service
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 2fa7387e1cb9..fd213a3995de 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -3,6 +3,7 @@ Description=NFS server and services
 Requires= proc-fs-nfsd.mount
 Requires= nfs-mountd.service
 Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service
 After= proc-fs-nfsd.mount nfs-mountd.service