From 5615e8924e9ebdf6808bb7a5f690a9d7c3af6dcd Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 13 Feb 2014 13:58:28 -0500 Subject: 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 Signed-off-by: NeilBrown Signed-off-by: Steve Dickson --- systemd/README | 6 +++++- systemd/nfs-server.service | 6 ++++++ systemd/nfs-server.target | 8 -------- 3 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 systemd/nfs-server.target diff --git a/systemd/README b/systemd/README index 58a4aca..34f1382 100644 --- a/systemd/README +++ b/systemd/README @@ -10,9 +10,13 @@ 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.target + 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 needs for an nfs client are enabled. diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service index dfe8dfa..26df656 100644 --- a/systemd/nfs-server.service +++ b/systemd/nfs-server.service @@ -2,6 +2,9 @@ Description=NFS server and services Requires= network.target proc-fs-nfsd.mount rpcbind.target PartOf=nfs-server.target +Requires= nfs-mountd.service +Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service +Wants=rpc-statd-notify.service After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service After= nfs-idmapd.service rpc-statd.service @@ -21,3 +24,6 @@ ExecStopPost=/usr/sbin/exportfs -au ExecStopPost=/usr/sbin/exportfs -f ExecReload=/usr/sbin/exportfs -r + +[Install] +WantedBy=multi-user.target diff --git a/systemd/nfs-server.target b/systemd/nfs-server.target deleted file mode 100644 index a3e629f..0000000 --- a/systemd/nfs-server.target +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=NFS server services -Requires=nfs-server.service nfs-mountd.service -Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service -Wants=rpc-statd-notify.service - -[Install] -WantedBy=multi-user.target -- cgit