public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Steve Dickson <steved@redhat.com>
Cc: linux-nfs@vger.kernel.org, Neil Brown <neilb@suse.de>,
	 Olga Kornievskaia <kolga@netapp.com>,
	Dai Ngo <Dai.Ngo@oracle.com>,  Tom Talpey <tom@talpey.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	 Lorenzo Bianconi <lorenzo@kernel.org>,
	Jeff Layton <jlayton@kernel.org>
Subject: [PATCH nfs-utils v6 3/3] systemd: use nfsdctl to start and stop the nfs server
Date: Mon, 22 Jul 2024 13:01:35 -0400	[thread overview]
Message-ID: <20240722-nfsdctl-v6-3-1b9d63710eb5@kernel.org> (raw)
In-Reply-To: <20240722-nfsdctl-v6-0-1b9d63710eb5@kernel.org>

Attempt to use nfsdctl to start and stop the nfs-server. If that fails
for any reason, use rpc.nfsd to do it instead.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 systemd/nfs-server.service | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index ac17d5286d3b..8793856aa707 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -23,8 +23,8 @@ After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
 Type=oneshot
 RemainAfterExit=yes
 ExecStartPre=-/usr/sbin/exportfs -r
-ExecStart=/usr/sbin/rpc.nfsd
-ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStart=/bin/sh -c '/usr/sbin/nfsdctl autostart || /usr/sbin/rpc.nfsd'
+ExecStop=/bin/sh -c '/usr/sbin/nfsdctl threads 0 || /usr/sbin/rpc.nfsd 0'
 ExecStopPost=/usr/sbin/exportfs -au
 ExecStopPost=/usr/sbin/exportfs -f
 

-- 
2.45.2


  parent reply	other threads:[~2024-07-22 17:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 17:01 [PATCH nfs-utils v6 0/3] nfsdctl: add a new nfsdctl tool to nfs-utils Jeff Layton
2024-07-22 17:01 ` [PATCH nfs-utils v6 1/3] nfsdctl: add the nfsdctl utility " Jeff Layton
2024-07-22 17:01 ` [PATCH nfs-utils v6 2/3] nfsdctl: asciidoc source for the manpage Jeff Layton
2024-07-22 17:01 ` Jeff Layton [this message]
2024-07-26 19:40 ` [PATCH nfs-utils v6 0/3] nfsdctl: add a new nfsdctl tool to nfs-utils Steve Dickson
2024-07-26 21:32   ` Jeff Layton
2024-07-26 21:59     ` Steve Dickson
2024-07-26 22:20       ` Jeff Layton
2024-07-27 11:28         ` Steve Dickson
2024-07-27 16:03         ` Chuck Lever III
2024-09-30 15:52 ` Jeff Layton
2024-09-30 16:16   ` Steve Dickson
2024-10-16 15:02     ` Jeff Layton
2024-10-16 20:10       ` Steve Dickson
2024-10-17 11:40 ` Steve Dickson
2024-10-17 15:22   ` Jeff Layton

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=20240722-nfsdctl-v6-3-1b9d63710eb5@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=kolga@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=neilb@suse.de \
    --cc=steved@redhat.com \
    --cc=tom@talpey.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