@@ -518,11 +518,6 @@ AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
# Make sure that $ACLOCAL_FLAGS are used during a rebuild
AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
-# make libexecdir available for substituion in config files
-# 2 "evals" needed late to expand variable names.
-AC_SUBST([_libexecdir])
-AC_CONFIG_COMMANDS_PRE([eval eval _libexecdir=$libexecdir])
-
# make _sysconfdir available for substituion in config files
# 2 "evals" needed late to expand variable names.
AC_SUBST([_sysconfdir])
@@ -530,7 +525,6 @@ AC_CONFIG_COMMANDS_PRE([eval eval _sysconfdir=$sysconfdir])
AC_CONFIG_FILES([
Makefile
- systemd/nfs-config.service
systemd/rpc-gssd.service
linux-nfs/Makefile
support/Makefile
@@ -5,7 +5,6 @@ MAINTAINERCLEANFILES = Makefile.in
unit_files = \
nfs-client.target \
\
- nfs-config.service \
nfs-mountd.service \
nfs-server.service \
nfs-utils.service \
@@ -19,8 +19,8 @@ by a suitable 'preset' setting:
can work (if no type is given, ".service" is assumed).
nfs-client.target
- If enabled, daemons needs for an nfs client are enabled.
- This does *not* include rpc.statd. the rpc-statd.service unit
+ If enabled, daemons needed for an nfs client are enabled.
+ This does *not* include rpc.statd. The rpc-statd.service unit
is started by /usr/sbin/start-statd which mount.nfs will run
if statd is needed.
@@ -52,11 +52,19 @@ It cannot stop rpc.statd or rpc.gssd as they may be in use by the
client and systemd cannot specify is two-pronged reverse dependency.
(i.e. stop this unit if none of these units are running)
-Distro specific commandline configuration can be provided by
-installing a script /usr/libexec/nfs-utils/nfs-utils_env.sh
-This should write /run/sysconfig/nfs-utils based on configuration
-information such as in /etc/sysconfig/nfs or /etc/defaults/nfs.
-It is run once by nfs-config.service.
+Distro specific configuration can be included in /etc/nfs.conf, or
+by providing drop-in files which replace the ExecStart line for a given
+service, and possibly add an EnvironmentFile line.
+
+For example, if systemd/system/nfs-mountd.service.d/local.conf
+contained
+ [Service]
+ EnvironmentFile=/etc/sysconfig/nfs
+ ExecStart=
+ ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDOPTS
+
+then the setting of RPCMOUNTDOPTS in /etc/sysconfig/nfs would be
+passed to rpc.mountd.
rpc.gssd and rpc.svcgssd are assumed to be needed if /etc/krb5.keytab
is present.
@@ -10,8 +10,7 @@ PartOf=nfs-utils.service
[Service]
Type=forking
PIDFile=/var/run/blkmapd.pid
-EnvironmentFile=-/run/sysconfig/nfs-utils
-ExecStart=/usr/sbin/blkmapd $BLKMAPDARGS
+ExecStart=/usr/sbin/blkmapd
[Install]
WantedBy=nfs-client.target
deleted file mode 100644
@@ -1,13 +0,0 @@
-[Unit]
-Description=Preprocess NFS configuration
-After=local-fs.target
-DefaultDependencies=no
-
-[Service]
-Type=oneshot
-# This service needs to run any time any nfs service
-# is started, so changes to local config files get
-# incorporated. Having "RemainAfterExit=no" (the default)
-# ensures this happens.
-RemainAfterExit=no
-ExecStart=@_libexecdir@/nfs-utils/nfs-utils_env.sh
@@ -6,10 +6,6 @@ After=var-lib-nfs-rpc_pipefs.mount local-fs.target
BindsTo=nfs-server.service
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
Type=forking
-ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
+ExecStart=/usr/sbin/rpc.idmapd
@@ -6,10 +6,6 @@ After=proc-fs-nfsd.mount
After=network.target local-fs.target
BindsTo=nfs-server.service
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
Type=forking
-ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS
+ExecStart=/usr/sbin/rpc.mountd
@@ -16,16 +16,11 @@ Before= rpc-statd-notify.service
Wants=auth-rpcgss-module.service
After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
-
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/sbin/exportfs -r
-ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
+ExecStart=/usr/sbin/rpc.nfsd
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -au
ExecStopPost=/usr/sbin/exportfs -f
@@ -9,11 +9,6 @@ ConditionPathExists=@_sysconfdir@/krb5.keytab
PartOf=nfs-utils.service
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
-
Type=forking
-ExecStart=/usr/sbin/rpc.gssd $GSSDARGS
+ExecStart=/usr/sbin/rpc.gssd
@@ -10,10 +10,6 @@ After=nfs-server.service
PartOf=nfs-utils.service
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
Type=forking
-ExecStart=-/usr/sbin/sm-notify $SMNOTIFYARGS
+ExecStart=-/usr/sbin/sm-notify
@@ -7,12 +7,8 @@ After=network.target nss-lookup.target rpcbind.socket
PartOf=nfs-utils.service
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
Environment=RPC_STATD_NO_NOTIFY=1
-EnvironmentFile=-/run/sysconfig/nfs-utils
Type=forking
PIDFile=/var/run/rpc.statd.pid
-ExecStart=/usr/sbin/rpc.statd $STATDARGS
+ExecStart=/usr/sbin/rpc.statd
@@ -11,10 +11,6 @@ ConditionPathExists=|!/run/gssproxy.pid
ConditionPathExists=|!/proc/net/rpc/use-gss-proxy
ConditionPathExists=/etc/krb5.keytab
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
Type=forking
-ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSDARGS
+ExecStart=/usr/sbin/rpc.svcgssd
Now that we have /etc/nfs.conf, a lot of configuration can be read directly. So nfs-config isn't really needed any more. Some distributions allow command-line arguments for various daemons to be set in an environment file (/etc/sysconfig, /etc/defaults). Passing these through /etc/nfs.conf is not possible. Instead, a distro that needs this functionality can create drop-in files which select the required value. As no commands are given default arguments by systemd unit files, the drop-in can just add distro-specific args. For example /lib/systemd/system/nfs-mountd.service.d/local.conf [Service] EnvironmentFile=/etc/sysconfig/nfs ExecStart= ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDOPTS Note the need for the empty assignment to remove existing definitions first. Signed-off-by: NeilBrown <neilb@suse.com> --- configure.ac | 6 ------ systemd/Makefile.am | 1 - systemd/README | 22 +++++++++++++++------- systemd/nfs-blkmap.service | 3 +-- systemd/nfs-config.service.in | 13 ------------- systemd/nfs-idmapd.service | 6 +----- systemd/nfs-mountd.service | 6 +----- systemd/nfs-server.service | 7 +------ systemd/rpc-gssd.service.in | 7 +------ systemd/rpc-statd-notify.service | 6 +----- systemd/rpc-statd.service | 6 +----- systemd/rpc-svcgssd.service | 6 +----- 12 files changed, 23 insertions(+), 66 deletions(-) delete mode 100644 systemd/nfs-config.service.in -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html