1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
Notes about systemd unit files for nfs-utils.
The unit files provided here should be sufficient for systemd
to manage all daemons and related services provides by nfs-utils.
They do *not* include any unit files for separate services such as
rpc.rquotad (in the 'quota' package) or rpcbind.
There are 4 units that can be 'enabled' or 'disabled' by systemctl, or
by a suitable 'preset' setting:
nfs-server.service
If enabled, nfs service is started together with dependencies
such as mountd, statd, rpc.idmapd
This is a "service" file rather than a "target" (which is the
normal grouping construct) so that
systemctl start nfs-server
can work (if no type is given, ".service" is assumed).
nfs-client.target
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.
nfs-blkmap.service
If enabled, then blkmapd will be run when nfs-client.target is
started.
Another special unit is "nfs-utils.service". This doesn't really do
anything, but exists so that other units may declare themselves as
"PartOf" nfs-utils.service.
The effect of this is that
systemctl restart nfs-utils
will restart all nfs-utils daemons as maybe be required during
software update. It isn't possible to make
systemctl try-restart nfs-server nfs-client.target
do this as some daemon are included in both, and rpc.statd would
not be restarted if nfs-server were not active (as nfs-client doesn't
Want it - it is started by mount.nfs running start-statd).
It is possible that we should have an nfs-statd.target which can
selectively enable statd being stared by -server and sm-notify
being started by -server or -client. That way it could be disabled
completely on V4-only configurations. Currently statd is always
started on the server and sm-notify is always run if server or
client is enabled.
Stopping nfs-server will also stop rpc.mountd, and rpc.svcgssd.
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 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.
If a site needs this file present but does not want the gss daemons
running, it should create
/etc/systemd/system/rpc-gssd.service.d/01-disable.conf
and
/etc/systemd/system/rpc-svcgssd.service.d/01-disable.conf
containing
[Unit]
ConditionNull=false
|