diff options
author | NeilBrown <neilb@suse.com> | 2016-12-06 13:27:22 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-12-20 13:29:04 -0500 |
commit | 2662e1ba98707014b6167e1e5bd3162d6d8f52af (patch) | |
tree | 93b0491ca662eefaa0f14eec14420909400c2909 | |
parent | d040649d9ced2a0e5aacd879ce227641ac77343d (diff) | |
download | nfs-utils-2662e1ba98707014b6167e1e5bd3162d6d8f52af.tar.gz |
systemd: Remove the nfs-config.service
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>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | systemd/Makefile.am | 1 | ||||
-rw-r--r-- | systemd/README | 22 | ||||
-rw-r--r-- | systemd/nfs-blkmap.service | 3 | ||||
-rw-r--r-- | systemd/nfs-config.service.in | 13 | ||||
-rw-r--r-- | systemd/nfs-idmapd.service | 6 | ||||
-rw-r--r-- | systemd/nfs-mountd.service | 6 | ||||
-rw-r--r-- | systemd/nfs-server.service | 7 | ||||
-rw-r--r-- | systemd/rpc-gssd.service.in | 7 | ||||
-rw-r--r-- | systemd/rpc-statd-notify.service | 6 | ||||
-rw-r--r-- | systemd/rpc-statd.service | 6 | ||||
-rw-r--r-- | systemd/rpc-svcgssd.service | 6 |
12 files changed, 23 insertions, 66 deletions
diff --git a/configure.ac b/configure.ac index 8a5aa2e..b3388a6 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/systemd/Makefile.am b/systemd/Makefile.am index b647ef0..b5ab157 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -5,7 +5,6 @@ MAINTAINERCLEANFILES = Makefile.in unit_files = \ nfs-client.target \ \ - nfs-config.service \ nfs-mountd.service \ nfs-server.service \ nfs-utils.service \ diff --git a/systemd/README b/systemd/README index 7c43df8..da23d6f 100644 --- a/systemd/README +++ b/systemd/README @@ -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. diff --git a/systemd/nfs-blkmap.service b/systemd/nfs-blkmap.service index ddbf4e9..ddc324e 100644 --- a/systemd/nfs-blkmap.service +++ b/systemd/nfs-blkmap.service @@ -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 diff --git a/systemd/nfs-config.service.in b/systemd/nfs-config.service.in deleted file mode 100644 index e89dc54..0000000 --- a/systemd/nfs-config.service.in +++ /dev/null @@ -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 diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service index df3dd9d..acca86b 100644 --- a/systemd/nfs-idmapd.service +++ b/systemd/nfs-idmapd.service @@ -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 diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service index 8a39f3e..15e828b 100644 --- a/systemd/nfs-mountd.service +++ b/systemd/nfs-mountd.service @@ -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 diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service index 196c818..5be5de6 100644 --- a/systemd/nfs-server.service +++ b/systemd/nfs-server.service @@ -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 diff --git a/systemd/rpc-gssd.service.in b/systemd/rpc-gssd.service.in index 1a7911c..b353027 100644 --- a/systemd/rpc-gssd.service.in +++ b/systemd/rpc-gssd.service.in @@ -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 diff --git a/systemd/rpc-statd-notify.service b/systemd/rpc-statd-notify.service index 89ba36c..7bfc9b1 100644 --- a/systemd/rpc-statd-notify.service +++ b/systemd/rpc-statd-notify.service @@ -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 diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service index d5392b7..60d600f 100644 --- a/systemd/rpc-statd.service +++ b/systemd/rpc-statd.service @@ -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 diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service index 41177b6..7187e3c 100644 --- a/systemd/rpc-svcgssd.service +++ b/systemd/rpc-svcgssd.service @@ -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 |