Skip to contentSkip to conversation

systemd: drop Wants=network-online.target for rpc-statd-notify

PATCH In review Dusty Mabe 2 participants 2 messages Jan 23 – Feb 1

Subsystems (2)
lore
Share & tools
lore

Dusty Mabe

author
#0 lore raw

PATCH 1/1 systemd: drop Wants=network-online.target for rpc-statd-notify

Pulling in network-online.target by default is generally discouraged. From [1]:

Quoted 5 lines

It is strongly recommended not to make use of this target too liberally:
for example network server software should generally not pull this in (since server software generally is happy to accept local connections even before any routable network interface is up). Its primary purpose is network client software that cannot operate without network.

On systems where nfs-client.target is enabled by default via presets (this is the case on Fedora today) then nfs-client.target will pull in rpc-statd-notify.service which will pull in network-online.target. This is the case even if the user hasn't configured any NFS mounts.

The man page for sm-notify already mentions:

Quoted 3 lines

Notifications are retried if sending fails, the remote does not respond, the remote's NSM service is not registered, or if there is a DNS failure which prevents the remote's mon_name from being resolved to an address.

So I would think it would be able to cope with a short period of time if it were to start before Networking were fully online.

Making this change means if you are in an offline scenario (one example is an install environment) then you won't have to wait for network-online.target to timeout before the system comes up fully.

We originally discussed this problem over in [2], [3].

[1] https://systemd.io/NETWORK_ONLINE/
[2] https://github.com/coreos/fedora-coreos-config/pull/3530
[3] https://bugzilla.redhat.com/show_bug.cgi?id=2383585

---
 systemd/rpc-statd-notify.service | 1 -
 1 file changed, 1 deletion(-)
systemd/rpc-statd-notify.service +0 -1
index 962f18b2..821d4ea8 100644
@@ -2,7 +2,6 @@
 Description=Notify NFS peers of a restart
 Documentation=man:sm-notify(8) man:rpc.statd(8)
 DefaultDependencies=no
-Wants=network-online.target
 After=local-fs.target network-online.target nss-lookup.target
 
 # if we run an nfs server, it needs to be running before we
Signature · 1 line
2.51.1
#1 lore raw
Quoted 27 lines · Dusty Mabe

Pulling in network-online.target by default is generally discouraged.
From [1]:

Quoted 5 lines

It is strongly recommended not to make use of this target too liberally:
for example network server software should generally not pull this in (since server software generally is happy to accept local connections even before any routable network interface is up). Its primary purpose is network client software that cannot operate without network.

On systems where nfs-client.target is enabled by default via presets (this is the case on Fedora today) then nfs-client.target will pull in rpc-statd-notify.service which will pull in network-online.target. This is the case even if the user hasn't configured any NFS mounts.

The man page for sm-notify already mentions:

Quoted 3 lines

Notifications are retried if sending fails, the remote does not respond, the remote's NSM service is not registered, or if there is a DNS failure which prevents the remote's mon_name from being resolved to an address.

So I would think it would be able to cope with a short period of time if it were to start before Networking were fully online.

Making this change means if you are in an offline scenario (one example is an install environment) then you won't have to wait for network-online.target to timeout before the system comes up fully.

Quoted 7 lines

We originally discussed this problem over in [2], [3].

[1] https://systemd.io/NETWORK_ONLINE/
[2] https://github.com/coreos/fedora-coreos-config/pull/3530
[3] https://bugzilla.redhat.com/show_bug.cgi?id=2383585

Committed... (tag: nfs-utils-2-8-5-rc3)

steved.

Quoted 16 lines
---
  systemd/rpc-statd-notify.service | 1 -
  1 file changed, 1 deletion(-)
systemd/rpc-statd-notify.service +0 -1
index 962f18b2..821d4ea8 100644
@@ -2,7 +2,6 @@
  Description=Notify NFS peers of a restart
  Documentation=man:sm-notify(8) man:rpc.statd(8)
  DefaultDependencies=no
-Wants=network-online.target
  After=local-fs.target network-online.target nss-lookup.target
 
  # if we run an nfs server, it needs to be running before we