walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
368cd44
diff -up nfs-utils-2.1.1/configure.ac.orig nfs-utils-2.1.1/configure.ac
368cd44
--- nfs-utils-2.1.1/configure.ac.orig	2017-01-12 10:21:39.000000000 -0500
8de6133
+++ nfs-utils-2.1.1/configure.ac	2017-04-26 12:22:25.320882445 -0400
368cd44
@@ -518,6 +518,11 @@ AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
368cd44
 # Make sure that $ACLOCAL_FLAGS are used during a rebuild
368cd44
 AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
368cd44
 
368cd44
+# make libexecdir available for substituion in config files
368cd44
+# 2 "evals" needed late to expand variable names.
368cd44
+AC_SUBST([_libexecdir])
368cd44
+AC_CONFIG_COMMANDS_PRE([eval eval _libexecdir=$libexecdir])
368cd44
+
368cd44
 # make _sysconfdir available for substituion in config files
368cd44
 # 2 "evals" needed late to expand variable names.
368cd44
 AC_SUBST([_sysconfdir])
368cd44
@@ -525,6 +530,7 @@ AC_CONFIG_COMMANDS_PRE([eval eval _sysco
368cd44
 
368cd44
 AC_CONFIG_FILES([
368cd44
 	Makefile
368cd44
+	systemd/nfs-config.service
368cd44
 	systemd/rpc-gssd.service
368cd44
 	linux-nfs/Makefile
368cd44
 	support/Makefile
368cd44
diff -up nfs-utils-2.1.1/systemd/Makefile.am.orig nfs-utils-2.1.1/systemd/Makefile.am
8de6133
--- nfs-utils-2.1.1/systemd/Makefile.am.orig	2017-04-26 12:21:44.759035047 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/Makefile.am	2017-04-26 12:22:25.321882441 -0400
49f282c
@@ -6,6 +6,7 @@ unit_files =  \
368cd44
     nfs-client.target \
49f282c
     rpc_pipefs.target \
368cd44
     \
368cd44
+    nfs-config.service \
368cd44
     nfs-mountd.service \
368cd44
     nfs-server.service \
368cd44
     nfs-utils.service \
368cd44
diff -up nfs-utils-2.1.1/systemd/nfs-blkmap.service.orig nfs-utils-2.1.1/systemd/nfs-blkmap.service
8de6133
--- nfs-utils-2.1.1/systemd/nfs-blkmap.service.orig	2017-04-26 12:21:44.759035047 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/nfs-blkmap.service	2017-04-26 12:22:25.321882441 -0400
368cd44
@@ -10,7 +10,8 @@ PartOf=nfs-utils.service
368cd44
 [Service]
368cd44
 Type=forking
368cd44
 PIDFile=/var/run/blkmapd.pid
368cd44
-ExecStart=/usr/sbin/blkmapd
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
+ExecStart=/usr/sbin/blkmapd $BLKMAPDARGS
368cd44
 
368cd44
 [Install]
368cd44
 WantedBy=nfs-client.target
368cd44
diff -up nfs-utils-2.1.1/systemd/nfs-config.service.in.orig nfs-utils-2.1.1/systemd/nfs-config.service.in
8de6133
--- nfs-utils-2.1.1/systemd/nfs-config.service.in.orig	2017-04-26 12:22:25.322882438 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/nfs-config.service.in	2017-04-26 12:22:25.322882438 -0400
368cd44
@@ -0,0 +1,13 @@
368cd44
+[Unit]
368cd44
+Description=Preprocess NFS configuration
368cd44
+After=local-fs.target
368cd44
+DefaultDependencies=no
368cd44
+
368cd44
+[Service]
368cd44
+Type=oneshot
368cd44
+# This service needs to run any time any nfs service
368cd44
+# is started, so changes to local config files get
368cd44
+# incorporated.  Having "RemainAfterExit=no" (the default)
368cd44
+# ensures this happens.
368cd44
+RemainAfterExit=no
368cd44
+ExecStart=@_libexecdir@/nfs-utils/nfs-utils_env.sh
368cd44
diff -up nfs-utils-2.1.1/systemd/nfs-idmapd.service.orig nfs-utils-2.1.1/systemd/nfs-idmapd.service
8de6133
--- nfs-utils-2.1.1/systemd/nfs-idmapd.service.orig	2017-04-26 12:21:44.759035047 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/nfs-idmapd.service	2017-04-26 12:22:25.322882438 -0400
49f282c
@@ -6,6 +6,10 @@ After=rpc_pipefs.target local-fs.target
368cd44
 
368cd44
 BindsTo=nfs-server.service
368cd44
 
368cd44
+Wants=nfs-config.service
368cd44
+After=nfs-config.service
368cd44
+
368cd44
 [Service]
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
 Type=forking
368cd44
-ExecStart=/usr/sbin/rpc.idmapd
368cd44
+ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
368cd44
diff -up nfs-utils-2.1.1/systemd/nfs-mountd.service.orig nfs-utils-2.1.1/systemd/nfs-mountd.service
8de6133
--- nfs-utils-2.1.1/systemd/nfs-mountd.service.orig	2017-04-26 12:21:44.765035024 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/nfs-mountd.service	2017-04-26 12:22:25.323882434 -0400
8de6133
@@ -8,6 +8,10 @@ After=network-online.target local-fs.tar
d2d905a
 After=rpcbind.socket
368cd44
 BindsTo=nfs-server.service
368cd44
 
368cd44
+Wants=nfs-config.service
368cd44
+After=nfs-config.service
368cd44
+
368cd44
 [Service]
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
 Type=forking
368cd44
-ExecStart=/usr/sbin/rpc.mountd
368cd44
+ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
368cd44
diff -up nfs-utils-2.1.1/systemd/nfs-server.service.orig nfs-utils-2.1.1/systemd/nfs-server.service
8de6133
--- nfs-utils-2.1.1/systemd/nfs-server.service.orig	2017-04-26 12:21:44.765035024 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/nfs-server.service	2017-04-26 12:22:25.323882434 -0400
368cd44
@@ -16,11 +16,16 @@ Before= rpc-statd-notify.service
368cd44
 Wants=auth-rpcgss-module.service
368cd44
 After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
368cd44
 
368cd44
+Wants=nfs-config.service
368cd44
+After=nfs-config.service
368cd44
+
368cd44
 [Service]
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
+
368cd44
 Type=oneshot
368cd44
 RemainAfterExit=yes
368cd44
 ExecStartPre=/usr/sbin/exportfs -r
368cd44
-ExecStart=/usr/sbin/rpc.nfsd
368cd44
+ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
368cd44
 ExecStop=/usr/sbin/rpc.nfsd 0
368cd44
 ExecStopPost=/usr/sbin/exportfs -au
368cd44
 ExecStopPost=/usr/sbin/exportfs -f
368cd44
diff -up nfs-utils-2.1.1/systemd/README.orig nfs-utils-2.1.1/systemd/README
368cd44
--- nfs-utils-2.1.1/systemd/README.orig	2017-01-12 10:21:39.000000000 -0500
8de6133
+++ nfs-utils-2.1.1/systemd/README	2017-04-26 12:22:25.324882430 -0400
368cd44
@@ -19,8 +19,8 @@ by a suitable 'preset' setting:
368cd44
     can work (if no type is given, ".service" is assumed).
368cd44
 
368cd44
  nfs-client.target
368cd44
-    If enabled, daemons needed for an nfs client are enabled.
368cd44
-    This does *not* include rpc.statd.  The rpc-statd.service unit
368cd44
+    If enabled, daemons needs for an nfs client are enabled.
368cd44
+    This does *not* include rpc.statd.  the rpc-statd.service unit
368cd44
     is started by /usr/sbin/start-statd which mount.nfs will run
368cd44
     if statd is needed.
368cd44
 
368cd44
@@ -52,19 +52,11 @@ It cannot stop rpc.statd or rpc.gssd as
368cd44
 client and systemd cannot specify is two-pronged reverse dependency.
368cd44
 (i.e. stop this unit if none of these units are running)
368cd44
 
368cd44
-Distro specific configuration can be included in /etc/nfs.conf, or
368cd44
-by providing drop-in files which replace the ExecStart line for a given
368cd44
-service, and possibly add an EnvironmentFile line.
368cd44
-
368cd44
-For example, if systemd/system/nfs-mountd.service.d/local.conf
368cd44
-contained
368cd44
-  [Service]
368cd44
-  EnvironmentFile=/etc/sysconfig/nfs
368cd44
-  ExecStart=
368cd44
-  ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDOPTS
368cd44
-
368cd44
-then the setting of RPCMOUNTDOPTS in /etc/sysconfig/nfs would be
368cd44
-passed to rpc.mountd.
368cd44
+Distro specific commandline configuration can be provided by
368cd44
+installing a script /usr/libexec/nfs-utils/nfs-utils_env.sh
368cd44
+This should write /run/sysconfig/nfs-utils based on configuration
368cd44
+information such as in /etc/sysconfig/nfs or /etc/defaults/nfs.
368cd44
+It is run once by nfs-config.service.
368cd44
 
368cd44
 rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab
368cd44
 is present.
368cd44
diff -up nfs-utils-2.1.1/systemd/rpc-gssd.service.in.orig nfs-utils-2.1.1/systemd/rpc-gssd.service.in
8de6133
--- nfs-utils-2.1.1/systemd/rpc-gssd.service.in.orig	2017-04-26 12:21:44.760035043 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/rpc-gssd.service.in	2017-04-26 12:22:25.324882430 -0400
368cd44
@@ -9,6 +9,11 @@ ConditionPathExists=@_sysconfdir@/krb5.k
368cd44
 
368cd44
 PartOf=nfs-utils.service
368cd44
 
368cd44
+Wants=nfs-config.service
368cd44
+After=nfs-config.service
368cd44
+
368cd44
 [Service]
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
+
368cd44
 Type=forking
368cd44
-ExecStart=/usr/sbin/rpc.gssd
368cd44
+ExecStart=/usr/sbin/rpc.gssd $RPCGSSDARGS
368cd44
diff -up nfs-utils-2.1.1/systemd/rpc-statd-notify.service.orig nfs-utils-2.1.1/systemd/rpc-statd-notify.service
8de6133
--- nfs-utils-2.1.1/systemd/rpc-statd-notify.service.orig	2017-04-26 12:21:44.765035024 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/rpc-statd-notify.service	2017-04-26 12:22:25.325882426 -0400
368cd44
@@ -10,6 +10,10 @@ After=nfs-server.service
368cd44
 
368cd44
 PartOf=nfs-utils.service
368cd44
 
368cd44
+Wants=nfs-config.service
368cd44
+After=nfs-config.service
368cd44
+
368cd44
 [Service]
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
 Type=forking
368cd44
-ExecStart=-/usr/sbin/sm-notify
368cd44
+ExecStart=-/usr/sbin/sm-notify $SMNOTIFYARGS
368cd44
diff -up nfs-utils-2.1.1/systemd/rpc-statd.service.orig nfs-utils-2.1.1/systemd/rpc-statd.service
8de6133
--- nfs-utils-2.1.1/systemd/rpc-statd.service.orig	2017-04-26 12:21:44.765035024 -0400
8de6133
+++ nfs-utils-2.1.1/systemd/rpc-statd.service	2017-04-26 12:22:25.325882426 -0400
8de6133
@@ -8,8 +8,12 @@ After=network-online.target nss-lookup.t
368cd44
 
368cd44
 PartOf=nfs-utils.service
368cd44
 
368cd44
+Wants=nfs-config.service
368cd44
+After=nfs-config.service
368cd44
+
368cd44
 [Service]
368cd44
 Environment=RPC_STATD_NO_NOTIFY=1
368cd44
+EnvironmentFile=-/run/sysconfig/nfs-utils
368cd44
 Type=forking
368cd44
 PIDFile=/var/run/rpc.statd.pid
368cd44
-ExecStart=/usr/sbin/rpc.statd
368cd44
+ExecStart=/usr/sbin/rpc.statd $STATDARGS