Fedora Account System
Red Hat Associate
Red Hat Customer
Can we remove the network-online.target dependency from rpc-statd-notify.service ? https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=systemd/rpc-statd-notify.service;h=962f18b209fa6f84ff6b53712d2dd9cecfc60c73;hb=9f974046c37b7c28705d5558328759fff708b1cb The man page for sm-notify already mentions: > 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. The reason I make this request is because in CoreOS/Image Mode we try to keep network-online.target out of the default bootup experience. User's can add their own services that pull it in, but we try not to have it be in there by default. More context in https://github.com/coreos/fedora-coreos-config/pull/3530#issuecomment-2932405290 and the following comments. Reproducible: Always
Here is the reason that was added ommit 9d4fc3fb5133be2df69fa380f80d1c660827fd1b (tag: nfs-utils-2-1-2-rc2) Author: Steve Dickson <steved> Date: Mon Apr 10 07:16:58 2017 -0400 systemd: NFS server services should use network-online There has been an number startup problems where parts of the NFS server fails to start due to DNS and other parts of the network not be up. Reading the systemd.special it seems network.target is a passive unit which does not wait for the entire network to come up and network-online.target is an active unit which does wait. So this adds Wants=network-online.target to all of the NFS server services Signed-off-by: Steve Dickson <steved>
ok some more info on why `rpc-statd-notify.service` is of particular interest. `nfs-client.target` is enabled by default in presets [1]. which means if you have the NFS packages installed even if you don't configure an NFS client it will get started. If you are in an offline scenario (one example is an install environment) network-online.target is still getting pulled in by default so you have to wait for that to timeout before you can get to the system. The proposal here is to remove `Wants=network-online.target` from `rpc-statd-notify.service`. In the case where other things pull in network-online.target then the `After=local-fs.target network-online.target nss-lookup.target` still exists and `rpc-statd-notify.service` will wait. In the case where nothing else pulls in `network-online.target` then `sm-notify` will start possibly before netowrking is up, but it will retry: ``` Notifications are retried if sending fails, the remote does not respond, the remote's NSM ser‐ vice is not registered, or if there is a DNS failure which prevents the remote's mon_name from being resolved to an address. ``` In a completely offline scenario, well the box probably didn't have any NFS client mounts anyway, but in this case sm-notify will eventually timeout, but at least the systemd service won't be marked as failed because: ``` ExecStart=-/usr/sbin/sm-notify ``` and ``` ├────────┼──────────────────────────────────────────┤ │ "-" │ If the executable path is prefixed with │ │ │ "-", an exit code of the command │ │ │ normally considered a failure (i.e. │ │ │ non-zero exit status or abnormal exit │ │ │ due to signal) is recorded, but has no │ │ │ further effect and is considered │ │ │ equivalent to success. │ ├────────┼──────────────────────────────────────────┤ ``` [1] https://src.fedoraproject.org/rpms/fedora-release/blob/68abb19e666e0872d61f5dc698931172101e94d4/f/90-default.preset#_451
And to show the dependency nfs-client.target/rpc-statd-notify.service/network-online.target dependency: ``` [core@cosa-devsh ~]$ systemctl list-dependencies --reverse network-online.target network-online.target ○ ├─docker.service ○ ├─fwupd-refresh.service ○ ├─iscsi.service ○ ├─nfs-idmapd.service ○ ├─nfs-mountd.service ○ ├─nfs-server.service ● ├─rpc-statd-notify.service ○ └─rpc-statd.service [core@cosa-devsh ~]$ [core@cosa-devsh ~]$ systemctl list-dependencies --reverse rpc-statd-notify.service rpc-statd-notify.service ○ ├─nfs-server.service ○ ├─nfs-utils.service ○ ├─rpc-statd.service ● └─nfs-client.target ● ├─multi-user.target ○ │ └─graphical.target ● └─remote-fs.target ○ ├─dracut-pre-pivot.service ● └─multi-user.target ○ └─graphical.target ```
Probably would be a good idea to test this proposed change - does sm-notify indeed properly send the reboot notification when the network finally arrives? Also, you could probably take the discussion for this change upstream - Steve D as maintainer is the person to convince.
Thanks Benjamin for responding! > (In reply to Benjamin Coddington from comment #4) > Probably would be a good idea to test this proposed change - does sm-notify > indeed properly send the reboot notification when the network finally > arrives? Good suggestion. I was hoping NFS had some automated test framework we could run the change through. If not I can try to test manually, but I will admit I am not an NFS expert. I'd like for my steps and results to be corroborated by someone who knows what they are doing. > Also, you could probably take the discussion for this change upstream - > Steve D as maintainer is the person to convince. Yep. I've engaged with Steve. Steve is there an upstream place you'd like me to send this proposal?
The commit that SteveD referenced in comment #1 was for https://bugzilla.redhat.com/show_bug.cgi?id=1409012, so you'll need to ensure that making that change doesn't cause a regression.
Hey Scott, I'll have to run some tests to confirm, but you can see from the output in https://bugzilla.redhat.com/show_bug.cgi?id=2383585#c3 that `nfs-server.service` (if enabled) depends on `network-online.target` directly so I don't think there's any risk of nfs-server not waiting for network-online.target.
(In reply to Dusty Mabe from comment #5) > > Steve is there an upstream place you'd like me to send this proposal? Yes... I will work with you to get a patch sent upstream (linux-nfs.org)
Here is how I send a patch(s) upstream... git clone git://linux-nfs.org/~steved/nfs-utils cd nfs-utils/ Edit file(s) to the changes ./autogen.sh # to create the configure file ./configure # to create the Makefile(s) make -j # to make sure things compile git commit -s -a # to commit the changes git format-patch -o /tmp -1 # or the number of patches # which put the patch(s) in /tmp git send-email "--dry-run" --suppress-cc=all --suppress-from --no-chain-reply-to \ --from "Your Name <Your Email>" \ --to "Linux NFS Mailing list <linux-nfs.org>" \ /tmp/*.patch # Note "--dry-run" is so you test the sending before you posted the patch(s)
posted up https://lore.kernel.org/linux-nfs/20260123143503.1342968-1-dusty@dustymabe.com/T/#u I skipped the compile steps since this patch is literally just a systemd unit change. Hope that is OK.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle. Changing version to 45.