File 0004-Centralize-dependencies-on-the-auth-unit.patch of Package nfs-utils

From 8d51c77c81f0cd5b0b8508eb50d5a53d6d2375ae Mon Sep 17 00:00:00 2001
From: Simo Sorce <>
Date: Tue, 30 Sep 2014 15:33:10 -0400
Subject: [PATCH] Centralize dependencies on the auth unit.

With this patch either gssproxy or rpc.svcgssd are started only if the
auth module is requested, and it finds a keytab.
If the wants are in the main nfs-client or nfs-server unit files then
the two deamons are started unconditionally and would require
conditions which we can test once and for all in a single unit file

Change also Before and After statments accordingly to properly
serialize loading modules and starting daemons in 3 steps
1. load kernel GSS auth module
2. start GSS handling daemons
3. start NFS client/server daemons

Signed-off-by: Simo Sorce <>
Signed-off-by: Steve Dickson <>
 systemd/auth-rpcgss-module.service | 3 ++-
 systemd/          | 7 +++++--
 systemd/nfs-server.service         | 8 +++++---
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/systemd/auth-rpcgss-module.service b/systemd/auth-rpcgss-module.service
index 3fc2f4ac924f..0355e13e0095 100644
--- a/systemd/auth-rpcgss-module.service
+++ b/systemd/auth-rpcgss-module.service
@@ -6,7 +6,8 @@
 # unit will fail.  But that's OK.)
 Description=Kernel Module supporting RPCSEC_GSS
-Before=gssproxy.service rpc-svcgssd.service
+Before=gssproxy.service rpc-svcgssd.service rpc-gssd.service
+Wants=gssproxy.service rpc-svcgssd.service rpc-gssd.service
diff --git a/systemd/ b/systemd/
index 87a1ce8cec8f..9b792a363e14 100644
--- a/systemd/
+++ b/systemd/
@@ -5,9 +5,12 @@
 # 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 auth-rpcgss-module.service
 Wants=nfs-blkmap.service rpc-statd-notify.service
-After=rpc-gssd.service rpc-svcgssd.service nfs-blkmap.service
+# GSS services dependencies and ordering
+After=rpc-gssd.service rpc-svcgssd.service gssproxy.service
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 1048c5cbbf68..8010aadc4870 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -2,15 +2,17 @@
 Description=NFS server and services
 Requires= proc-fs-nfsd.mount
 Requires= nfs-mountd.service
-Wants=rpc-statd.service nfs-idmapd.service auth-rpcgss-module.service
-Wants=rpc-gssd.service gssproxy.service rpc-svcgssd.service
+Wants=rpc-statd.service nfs-idmapd.service
 After= proc-fs-nfsd.mount nfs-mountd.service
 After= nfs-idmapd.service rpc-statd.service
-After= rpc-gssd.service gssproxy.service rpc-svcgssd.service
 Before= rpc-statd-notify.service
+# GSS services dependencies and ordering
+After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
openSUSE Build Service is sponsored by