linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rafael David Tinoco <rafael.tinoco@canonical.com>
To: linux-nfs@vger.kernel.org
Cc: neilb@suse.com
Subject: [PATCH] Fix nfs-mountd dependency on rpcbind
Date: Tue,  7 Feb 2017 17:16:50 -0200	[thread overview]
Message-ID: <20170207191650.19219-1-rafael.tinoco@canonical.com> (raw)

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


             reply	other threads:[~2017-02-07 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 19:16 Rafael David Tinoco [this message]
2017-02-07 23:03 ` [PATCH] Fix nfs-mountd dependency on rpcbind NeilBrown
2017-02-16 10:22 ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207191650.19219-1-rafael.tinoco@canonical.com \
    --to=rafael.tinoco@canonical.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).