* [PATCH nfs-utils] systemd units: merge nfs-server.service and nfs-server.target
@ 2014-02-04 1:09 NeilBrown
2014-02-13 19:40 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: NeilBrown @ 2014-02-04 1:09 UTC (permalink / raw)
To: Steve Dickson, linux-nfs
[-- Attachment #1: Type: text/plain, Size: 2634 bytes --]
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 <SteveD@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/systemd/README b/systemd/README
index f0fb68825499..00d3e415092e 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 9812866c66aa..6ba2fc0f346e 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -1,8 +1,10 @@
[Unit]
-Description=NFS server
+Description=NFS server and services
DefaultDependencies=no
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
@@ -22,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 a3e629f022a9..000000000000
--- 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH nfs-utils] systemd units: merge nfs-server.service and nfs-server.target
2014-02-04 1:09 [PATCH nfs-utils] systemd units: merge nfs-server.service and nfs-server.target NeilBrown
@ 2014-02-13 19:40 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2014-02-13 19:40 UTC (permalink / raw)
To: NeilBrown, linux-nfs
On 02/03/2014 08:09 PM, NeilBrown wrote:
>
> 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 <SteveD@redhat.com>
> Signed-off-by: NeilBrown <neilb@suse.de>
Committed to systemd branch of my git tree...
steved.
>
> diff --git a/systemd/README b/systemd/README
> index f0fb68825499..00d3e415092e 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 9812866c66aa..6ba2fc0f346e 100644
> --- a/systemd/nfs-server.service
> +++ b/systemd/nfs-server.service
> @@ -1,8 +1,10 @@
> [Unit]
> -Description=NFS server
> +Description=NFS server and services
> DefaultDependencies=no
> 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
> @@ -22,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 a3e629f022a9..000000000000
> --- 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-13 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-04 1:09 [PATCH nfs-utils] systemd units: merge nfs-server.service and nfs-server.target NeilBrown
2014-02-13 19:40 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).