linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: steved@redhat.com
Cc: jlayton@kernel.org, linux-nfs@vger.kernel.org
Subject: [nfs-utils PATCH RFC 5/7] nfsdcld: the -p option should specify the rpc_pipefs mountpoint
Date: Tue,  6 Nov 2018 13:36:18 -0500	[thread overview]
Message-ID: <20181106183620.18609-6-smayhew@redhat.com> (raw)
In-Reply-To: <20181106183620.18609-1-smayhew@redhat.com>

Change the -p option to specify the rpc_pipefs mountpoint rather than
the full path to the cld pipe file.  This is consistent with other
daemons that use the rpc_pipefs filesystem.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 utils/nfsdcld/nfsdcld.c   | 17 ++++++++++-------
 utils/nfsdcld/nfsdcld.man |  9 ++++-----
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c
index 9b1ad98..272c7c5 100644
--- a/utils/nfsdcld/nfsdcld.c
+++ b/utils/nfsdcld/nfsdcld.c
@@ -46,11 +46,11 @@
 #include "sqlite.h"
 #include "../mount/version.h"
 
-#ifndef PIPEFS_DIR
-#define PIPEFS_DIR NFS_STATEDIR "/rpc_pipefs"
+#ifndef DEFAULT_PIPEFS_DIR
+#define DEFAULT_PIPEFS_DIR NFS_STATEDIR "/rpc_pipefs"
 #endif
 
-#define DEFAULT_CLD_PATH	PIPEFS_DIR "/nfsd/cld"
+#define DEFAULT_CLD_PATH	"/nfsd/cld"
 
 #ifndef CLD_DEFAULT_STORAGEDIR
 #define CLD_DEFAULT_STORAGEDIR NFS_STATEDIR "/nfsdcld"
@@ -63,7 +63,8 @@
 /* private data structures */
 
 /* global variables */
-static char *pipepath = DEFAULT_CLD_PATH;
+static char pipefs_dir[PATH_MAX] = DEFAULT_PIPEFS_DIR;
+static char pipepath[PATH_MAX];
 static int 		inotify_fd = -1;
 static struct event	pipedir_event;
 static bool old_kernel = false;
@@ -73,7 +74,7 @@ static struct option longopts[] =
 	{ "help", 0, NULL, 'h' },
 	{ "foreground", 0, NULL, 'F' },
 	{ "debug", 0, NULL, 'd' },
-	{ "pipe", 1, NULL, 'p' },
+	{ "pipefsdir", 1, NULL, 'p' },
 	{ "storagedir", 1, NULL, 's' },
 	{ NULL, 0, 0, 0 },
 };
@@ -84,7 +85,7 @@ static void cldcb(int UNUSED(fd), short which, void *data);
 static void
 usage(char *progname)
 {
-	printf("%s [ -hFd ] [ -p pipe ] [ -s dir ]\n", progname);
+	printf("%s [ -hFd ] [ -p pipefsdir ] [ -s storagedir ]\n", progname);
 }
 
 static int
@@ -663,7 +664,7 @@ main(int argc, char **argv)
 			foreground = true;
 			break;
 		case 'p':
-			pipepath = optarg;
+			strlcpy(pipefs_dir, optarg, sizeof(pipefs_dir));
 			break;
 		case 's':
 			storagedir = optarg;
@@ -674,6 +675,8 @@ main(int argc, char **argv)
 		}
 	}
 
+	strlcpy(pipepath, pipefs_dir, sizeof(pipepath));
+	strlcat(pipepath, DEFAULT_CLD_PATH, sizeof(pipepath));
 
 	xlog_open(progname);
 	if (!foreground) {
diff --git a/utils/nfsdcld/nfsdcld.man b/utils/nfsdcld/nfsdcld.man
index 9ddaf64..b607ba6 100644
--- a/utils/nfsdcld/nfsdcld.man
+++ b/utils/nfsdcld/nfsdcld.man
@@ -155,11 +155,10 @@ Enable debug level logging.
 .IP "\fB\-F\fR, \fB\-\-foreground\fR" 4
 .IX Item "-F, --foreground"
 Runs the daemon in the foreground and prints all output to stderr
-.IP "\fB\-p\fR \fIpipe\fR, \fB\-\-pipe\fR=\fIpipe\fR" 4
-.IX Item "-p pipe, --pipe=pipe"
-Location of the \*(L"cld\*(R" upcall pipe. The default value is
-\&\fI/var/lib/nfs/rpc_pipefs/nfsd/cld\fR. If the pipe does not exist when the
-daemon starts then it will wait for it to be created.
+.IP "\fB\-p\fR \fIpath\fR, \fB\-\-pipefsdir\fR=\fIpath\fR" 4
+.IX Item "-p path, --pipefsdir=path"
+Location of the rpc_pipefs filesystem. The default value is
+\&\fI/var/lib/nfs/rpc_pipefs\fR.
 .IP "\fB\-s\fR \fIstorage_dir\fR, \fB\-\-storagedir\fR=\fIstorage_dir\fR" 4
 .IX Item "-s storagedir, --storagedir=storage_dir"
 Directory where stable storage information should be kept. The default
-- 
2.17.1


  parent reply	other threads:[~2018-11-06 18:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 18:36 [nfs-utils PATCH RFC 0/7] restore nfsdcld Scott Mayhew
2018-11-06 18:36 ` [nfs-utils PATCH RFC 1/7] Revert "nfsdcltrack: remove the nfsdcld daemon" Scott Mayhew
2018-11-06 18:36 ` [nfs-utils PATCH RFC 2/7] nfsdcld: move nfsdcld to its own directory Scott Mayhew
2018-11-06 18:36 ` [nfs-utils PATCH RFC 3/7] nfsdcld: a few enhancements Scott Mayhew
2018-11-10 14:16   ` Jeff Layton
2018-11-06 18:36 ` [nfs-utils PATCH RFC 4/7] nfsdcld: remove some unused functions Scott Mayhew
2018-11-06 18:36 ` Scott Mayhew [this message]
2018-11-06 18:36 ` [nfs-utils PATCH RFC 6/7] nfsdcld: add /etc/nfs.conf support Scott Mayhew
2018-11-08 12:00   ` Steve Dickson
2018-11-08 13:09     ` Scott Mayhew
2018-11-06 18:36 ` [nfs-utils PATCH RFC 7/7] systemd: add a unit file for nfsdcld Scott Mayhew

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=20181106183620.18609-6-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.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).