Skip to contentSkip to conversation

systemd/rpc-statd.service - add IgnoreOnIsolate=yes

PATCH In review NeilBrown 2 participants 2 messages Nov 28, 2018 – Nov 29, 2018

Subsystems (2)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 systemd/rpc-statd.service - add IgnoreOnIsolate=yes

If you run
systemctl isolate multi-user.target
then all services not needed by multi-user.target are stopped. This currently includes rpc-statd, which is a problem.

Systemd doesn't know that rpc-statd.service is needed by multi-user.target, or more accurately nfs-client.target, because sometimes it isn't.
It is started dynamically by mount.nfs when a v3 or v2 filesystem is mounted (not when v4 is mounted) - so systemd doesn't see the connection.

mount units default to IgnoreOnIsolate=yes, as mounts are expected to be left mounted when you run "systemctl isolate ....". As rpc-statd.service is started by a mount, and needed for some mounts, it makes sense for it to declare IgnoreOnIsolate=yes too.
With this declaration in place rpc.statd remains running when
systemctl isolate multi-user.target
is run.

---
 systemd/rpc-statd.service | 1 +
 1 file changed, 1 insertion(+)
systemd/rpc-statd.service +1 -0
index f41ae2084f3c..1f4e6a8b92ab 100644
@@ -7,6 +7,7 @@ Wants=network-online.target
 After=network-online.target nss-lookup.target rpcbind.socket
 
 PartOf=nfs-utils.service
+IgnoreOnIsolate=yes
 
 [Service]
 Environment=RPC_STATD_NO_NOTIFY=1
Signature · 1 line
2.14.0.rc0.dirty
#1 lore raw
Quoted 19 lines · NeilBrown

If you run
systemctl isolate multi-user.target
then all services not needed by multi-user.target are stopped. This currently includes rpc-statd, which is a problem.

Systemd doesn't know that rpc-statd.service is needed by multi-user.target, or more accurately nfs-client.target, because sometimes it isn't.
It is started dynamically by mount.nfs when a v3 or v2 filesystem is mounted (not when v4 is mounted) - so systemd doesn't see the connection.

mount units default to IgnoreOnIsolate=yes, as mounts are expected to be left mounted when you run "systemctl isolate ....". As rpc-statd.service is started by a mount, and needed for some mounts, it makes sense for it to declare IgnoreOnIsolate=yes too.
With this declaration in place rpc.statd remains running when
systemctl isolate multi-user.target
is run.

Quoted 1 line

Committed....

steved.

Quoted 18 lines
---
 systemd/rpc-statd.service | 1 +
 1 file changed, 1 insertion(+)
systemd/rpc-statd.service +1 -1
index f41ae2084f3c..1f4e6a8b92ab 100644
@@ -7,6 +7,7 @@ Wants=network-online.target
 After=network-online.target nss-lookup.target rpcbind.socket
 
 PartOf=nfs-utils.service
+IgnoreOnIsolate=yes
 
 [Service]
 Environment=RPC_STATD_NO_NOTIFY=1
-- 2.14.0.rc0.dirty