systemd units: create nfs-config.service as single location to process config.
Instead of processing the config information into command lines every
time it might be needed, do it once in a separate service that other
services can Want.
systemd: convert secure services to start without explicit
configuration.
This patch removes nfs-secure.target. Instead, rpc.gssd and
rpc.svcgssd start started if they appear to be needed.
For rpc.gssd, this means if the file /etc/krb5.keytab exists.
As the only security mechanism supported is krb5, that file must exist
for rpc.gssd to be useful. Conversely, if it does exist, it seems very
likely that krb5 is configured on the system an may be used for NFS.
For rpc.svcgssd, it also means checking if gss-proxy might be performing
the equivalent task instead. So we check if it is running, and if the
kernel is able to talk to it.
systemd units: merge nfs-server.service and nfs-server.target
With systemd, a 'service' should run a single server while a 'target'
can be used to group services.
As nfs service is really a group of services a 'target' makes more
sense.
However that means that we need commands like
systemctl start nfs-server.target
rather than the more simple
systemctl start nfs-server
As the target/service separate doesn't bring any gain except a minor
aesthetic, and does bring a practical inconvenience, this patch merges
nfs-server.target into nfs-server.service.
Reported-by: Steve Dickson <email address hidden>
Signed-off-by: NeilBrown <email address hidden>
Signed-off-by: Steve Dickson <email address hidden>
DefaultDependencies should be "yes" (the default) for things
needed only be the NFS server, as that is a service that doesn't
need to start early.
DefaultDependencies should be "no" for things needed to mount an
NFS filesystem, and filesystems are mounted before basic.target.
To ensure these services are shut down in a timely fashion, they
must Conflict with systemd.umount so they are shutdown when everything
is unmounted.
systemd: add nfs-utils.service which can be used to restart everything.
With this patch, systemctl restart nfs-utils will restart any
nfs-utils daemons that are currently running, whether there were
started via nfs-server.service, nfs-client.target, or directly by
systemctl.