aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorScott Mayhew <smayhew@redhat.com>2019-04-16 11:48:01 -0400
committerSteve Dickson <steved@redhat.com>2019-04-16 14:22:08 -0400
commita8ce6c346193f2c89012da7bea34d7b59b38c035 (patch)
tree3e3f2c1d71fa584d95860f8e5c8f309ab262a304 /utils
parentc2b303c57350ac8d511ccc9d98ae484ac7d49af6 (diff)
downloadnfs-utils-a8ce6c346193f2c89012da7bea34d7b59b38c035.tar.gz
nfsdcld: the -p option should specify the rpc_pipefs mountpoint
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> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/nfsdcld/nfsdcld.c17
-rw-r--r--utils/nfsdcld/nfsdcld.man9
2 files changed, 14 insertions, 12 deletions
diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c
index 9b1ad98a..272c7c58 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 9ddaf64c..b607ba64 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