Skip to contentSkip to conversation

Fix nfs-mountd dependency on rpcbind

PATCH In review Rafael David Tinoco 3 participants 3 messages Feb 7, 2017 – Feb 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix nfs-mountd dependency on rpcbind

Following commit 91da135f - it replaced "rpcbind.target" by "rpcbind.socket" in some unit files - "rpcbind.socket" should also be added to "nfs-mountd.service" as a dependency to avoid race conditions.

Usually "rpcbind.socket" is either started as a "sockets.target" dependency, or as a dependency for "nfs-server.service", when unit files include it in "BindsTo" or "After". Unfortunately there is a possilibility to have "nfs-mountd.service" started when the rpcbind socket is not yet created:

systemd[1]: Starting NFS Mount Daemon...
systemd[1]: nfs-mountd.service: Control process exited, code=exited status=1 systemd[1]: Failed to start NFS Mount Daemon.
systemd[1]: nfs-mountd.service: Unit entered failed state. systemd[1]: nfs-mountd.service: Failed with result 'exit-code'.

Nowadays "nfs-mountd.service" uses "BindTo" directive to "nfs-server.service". That, per se, doesn't guarantee ordering for NFS server to start rpcbind and for nfs-mountd to depend on it.

https://bugs.launchpad.net/bugs/1590799

---
 systemd/nfs-mountd.service | 1 +
 1 file changed, 1 insertion(+)
systemd/nfs-mountd.service +1 -0
index 15e828b..b0a8bc0 100644
@@ -4,6 +4,7 @@ DefaultDependencies=no
 Requires=proc-fs-nfsd.mount
 After=proc-fs-nfsd.mount
 After=network.target local-fs.target
+After=rpcbind.socket
 BindsTo=nfs-server.service
 
 [Service]
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Rafael David Tinoco

Following commit 91da135f - it replaced "rpcbind.target" by "rpcbind.socket" in some unit files - "rpcbind.socket" should also be added to "nfs-mountd.service" as a dependency to avoid race conditions.

Usually "rpcbind.socket" is either started as a "sockets.target" dependency, or as a dependency for "nfs-server.service", when unit files include it in "BindsTo" or "After". Unfortunately there is a possilibility to have "nfs-mountd.service" started when the rpcbind socket is not yet created:

systemd[1]: Starting NFS Mount Daemon...
systemd[1]: nfs-mountd.service: Control process exited, code=exited status=1 systemd[1]: Failed to start NFS Mount Daemon.
systemd[1]: nfs-mountd.service: Unit entered failed state. systemd[1]: nfs-mountd.service: Failed with result 'exit-code'.

Quoted 7 lines

Nowadays "nfs-mountd.service" uses "BindTo" directive to "nfs-server.service". That, per se, doesn't guarantee ordering for NFS server to start rpcbind and for nfs-mountd to depend on it.

https://bugs.launchpad.net/bugs/1590799

Thanks for finding this!

I would not be against adding
Wants=rpcbind.socket

but as you say, it isn't strictly needed.

Thanks,
NeilBrown

Quoted 18 lines
---
 systemd/nfs-mountd.service | 1 +
 1 file changed, 1 insertion(+)
systemd/nfs-mountd.service +1 -0
index 15e828b..b0a8bc0 100644
@@ -4,6 +4,7 @@ DefaultDependencies=no
 Requires=proc-fs-nfsd.mount
 After=proc-fs-nfsd.mount
 After=network.target local-fs.target
+After=rpcbind.socket
 BindsTo=nfs-server.service
 
 [Service]
Signature · 1 line
2.9.3
#2 lore raw
In reply to Rafael David Tinoco
Quoted 15 lines · Rafael David Tinoco

Following commit 91da135f - it replaced "rpcbind.target" by "rpcbind.socket" in some unit files - "rpcbind.socket" should also be added to "nfs-mountd.service" as a dependency to avoid race conditions.

Usually "rpcbind.socket" is either started as a "sockets.target" dependency, or as a dependency for "nfs-server.service", when unit files include it in "BindsTo" or "After". Unfortunately there is a possilibility to have "nfs-mountd.service" started when the rpcbind socket is not yet created:

systemd[1]: Starting NFS Mount Daemon...
systemd[1]: nfs-mountd.service: Control process exited, code=exited status=1 systemd[1]: Failed to start NFS Mount Daemon.
systemd[1]: nfs-mountd.service: Unit entered failed state. systemd[1]: nfs-mountd.service: Failed with result 'exit-code'.

Quoted 7 lines

Nowadays "nfs-mountd.service" uses "BindTo" directive to "nfs-server.service". That, per se, doesn't guarantee ordering for NFS server to start rpcbind and for nfs-mountd to depend on it.

https://bugs.launchpad.net/bugs/1590799

Committed

steved.

Quoted 16 lines
---
 systemd/nfs-mountd.service | 1 +
 1 file changed, 1 insertion(+)
systemd/nfs-mountd.service +1 -0
index 15e828b..b0a8bc0 100644
@@ -4,6 +4,7 @@ DefaultDependencies=no
 Requires=proc-fs-nfsd.mount
 After=proc-fs-nfsd.mount
 After=network.target local-fs.target
+After=rpcbind.socket
 BindsTo=nfs-server.service
 
 [Service]