All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix nfs-mountd dependency on rpcbind
@ 2017-02-07 19:16 Rafael David Tinoco
  2017-02-07 23:03 ` NeilBrown
  2017-02-16 10:22 ` Steve Dickson
  0 siblings, 2 replies; 3+ messages in thread
From: Rafael David Tinoco @ 2017-02-07 19:16 UTC (permalink / raw)
  To: linux-nfs; +Cc: neilb

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

Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com>
---
 systemd/nfs-mountd.service | 1 +
 1 file changed, 1 insertion(+)

diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
index 15e828b..b0a8bc0 100644
--- a/systemd/nfs-mountd.service
+++ b/systemd/nfs-mountd.service
@@ -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]
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix nfs-mountd dependency on rpcbind
  2017-02-07 19:16 [PATCH] Fix nfs-mountd dependency on rpcbind Rafael David Tinoco
@ 2017-02-07 23:03 ` NeilBrown
  2017-02-16 10:22 ` Steve Dickson
  1 sibling, 0 replies; 3+ messages in thread
From: NeilBrown @ 2017-02-07 23:03 UTC (permalink / raw)
  To: Rafael David Tinoco, linux-nfs

[-- Attachment #1: Type: text/plain, Size: 1887 bytes --]

On Tue, Feb 07 2017, Rafael David Tinoco wrote:

> 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
>
> Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com>

Thanks for finding this!

 Reviewed-by: NeilBrown <neilb@suse.com>

I would not be against adding
  Wants=rpcbind.socket

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

Thanks,
NeilBrown


> ---
>  systemd/nfs-mountd.service | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
> index 15e828b..b0a8bc0 100644
> --- a/systemd/nfs-mountd.service
> +++ b/systemd/nfs-mountd.service
> @@ -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]
> -- 
> 2.9.3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix nfs-mountd dependency on rpcbind
  2017-02-07 19:16 [PATCH] Fix nfs-mountd dependency on rpcbind Rafael David Tinoco
  2017-02-07 23:03 ` NeilBrown
@ 2017-02-16 10:22 ` Steve Dickson
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2017-02-16 10:22 UTC (permalink / raw)
  To: Rafael David Tinoco, linux-nfs; +Cc: neilb



On 02/07/2017 02:16 PM, Rafael David Tinoco wrote:
> 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
>
> Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com>
Committed

steved.
> ---
>  systemd/nfs-mountd.service | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
> index 15e828b..b0a8bc0 100644
> --- a/systemd/nfs-mountd.service
> +++ b/systemd/nfs-mountd.service
> @@ -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]


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-16 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 19:16 [PATCH] Fix nfs-mountd dependency on rpcbind Rafael David Tinoco
2017-02-07 23:03 ` NeilBrown
2017-02-16 10:22 ` Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.