Comment 14 for bug 1590799

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Okay, sorry for the delay. It took me sometime to review all SysV, Upstart scripts and Systemd unit files. What "linuxball" said is correct, we're missing rpcbind dependency for nfs-mountd.service.

# nfs-server.service

[Unit]
...
Requires= network.target proc-fs-nfsd.mount rpcbind.target
Requires= nfs-mountd.service
Wants= nfs-idmapd.service

After= local-fs.target
After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service
After= nfs-idmapd.service rpc-statd.service
Before= rpc-statd-notify.service

Wants=auth-rpcgss-module.service
After=rpc-gssd.service rpc-svcgssd.service

Before=remote-fs-pre.target

Wants=nfs-config.service
After=nfs-config.service

As it stands, "rpcbind.target is being put as a dependency and to run before "nfs-server.service" but not before "nfs-mountd.service":

[Unit]
...
Requires=proc-fs-nfsd.mount
After=proc-fs-nfsd.mount
After=network.target local-fs.target
BindsTo=nfs-server.service

Wants=nfs-config.service
After=nfs-config.service

Since the services run in parallel there is an window of opportunity for "nfs-mountd.service" to be started before "rpcbind.target".

Only problem is that rpcbind.target is for synchronization with SysV scripts:

rpcbind.target
The portmapper/rpcbind pulls in this target and orders itself before it, to indicate its availability. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$portmap" facility.

Right now we have:

system/nfs-server.service:Requires= ... rpcbind.target
system/nfs-server.service:After= ... rpcbind.target ...
system/rpc-statd.service:Requires= ... rpcbind.target
system/rpc-statd.service:After= ... rpcbind.target

So the correct fix would be:

Wants= ... rpcbind.target
After= ... rpcbind.target

For all NFS daemons depending on rpcbind to be fully operational, since the systemd generators would take also care of SysV script dependencies (allegedly if rpcbind is started through SysV generator).

The thing is that, this upstream discussion has taken place:

https://patchwork.kernel.org/patch/8976701/

I think I should move on and "cherry-pick" this change as well. Upstream "Linux NFS" changed the dependency from "target" to "service" - which makes perfectly sense based on the explanation from Neil Brown.

I'm providing a PPA soon and will ask for feedback and, at the same time, I'll attach this small fix as a debdiff proposal for sponsors team to upload it to -propose if your feedback is good. I'd like to ask you to reproduce the issue and to make sure issue is gone with the package I'll provide.

Sorry for the amount of time this bug was opened without a fix. I think it never gained much traction because the workaround as simple so people had stick with the workaround you guys provided.
Jeroen, if you want to understand how Ubuntu development works, specifically for fixes you can read this Wiki: https://wiki.ubuntu.com/StableReleaseUpdates.

Will get back to this today.