diff options
author | NeilBrown <neilb@suse.com> | 2016-11-16 13:15:44 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-11-16 13:16:21 -0500 |
commit | 126c48afb88245a03bd5e388846d5a68ed4bb2df (patch) | |
tree | 8b78e19b93ebd752ff2e44c3932971c656de0e5f /utils/nfsdcltrack | |
parent | 394e388e1e62d88f2771a3a65ed34c63c1e481bf (diff) | |
download | nfs-utils-126c48afb88245a03bd5e388846d5a68ed4bb2df.tar.gz |
nfsdcltrack: read configuration from a filenfs-utils-1-3-5-rc3
As nfsdcltrack is normally run directly from the kernel
there is no opportunity to change the default
storage directory. This can be useful in a cluster to
locate the "storage directory" on shared storage.
The easiest alternative is to allow configuration to be read from a
file, particularly as nfs-utils already has code for parsing a config
file.
So read the config file "/etc/nfs.conf" (or as set by ./configure) and
look for "storagedir" and "debug" in the "nfsdcltrack" section.
These values can still be over-ridden by command line options.
A generic name (nfs.conf) was changes for the config file so that
other daemons can be enhanced to read configuration from there.
This may be easier than passing command line arguments through systemd.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/nfsdcltrack')
-rw-r--r-- | utils/nfsdcltrack/nfsdcltrack.c | 12 | ||||
-rw-r--r-- | utils/nfsdcltrack/nfsdcltrack.man | 14 |
2 files changed, 26 insertions, 0 deletions
diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c index fcdda7f..e6e514b 100644 --- a/utils/nfsdcltrack/nfsdcltrack.c +++ b/utils/nfsdcltrack/nfsdcltrack.c @@ -43,6 +43,7 @@ #include <sys/capability.h> #endif +#include "conffile.h" #include "xlog.h" #include "sqlite.h" @@ -55,6 +56,8 @@ /* defined by RFC 3530 */ #define NFS4_OPAQUE_LIMIT 1024 +char *conf_path = NFS_CONFFILE; + /* private data structures */ struct cltrack_cmd { char *name; @@ -553,6 +556,7 @@ int main(int argc, char **argv) { char arg; + char *val; int rc = 0; char *progname, *cmdarg = NULL; struct cltrack_cmd *cmd; @@ -562,6 +566,14 @@ main(int argc, char **argv) xlog_syslog(1); xlog_stderr(0); + conf_init(); + val = conf_get_str("nfsdcltrack", "storagedir"); + if (val) + storagedir = val; + rc = conf_get_num("nfsdcltrack", "debug", 0); + if (rc > 0) + xlog_config(D_ALL, 1); + /* process command-line options */ while ((arg = getopt_long(argc, argv, "hdfs:", longopts, NULL)) != EOF) { diff --git a/utils/nfsdcltrack/nfsdcltrack.man b/utils/nfsdcltrack/nfsdcltrack.man index 4b8f4d7..cc24b7a 100644 --- a/utils/nfsdcltrack/nfsdcltrack.man +++ b/utils/nfsdcltrack/nfsdcltrack.man @@ -67,6 +67,20 @@ Check to see if a nfs_client_id4 is allowed to reclaim. This command requires a .IP "\fBgracedone\fR" 4 .IX Item "gracedone" Remove any unreclaimed client records from the database. This command requires a epoch boot time as an argument. +.SH "EXTERNAL CONFIGURATION" +The directory for stable storage information can be set via the file +.B /etc/nfs.conf +by setting the +.B storagedir +value in the +.B nfsdcltrack +section. For example: +.in +5 +[nfsdcltrack] +.br + storagedir = /shared/nfs/nfsdcltrack +.in -5 +Debuging to syslog can also be enabled by setting "debug = 1" in this file. .SH "LEGACY TRANSITION MECHANISM" .IX Header "LEGACY TRANSITION MECHANISM" The Linux kernel NFSv4 server has historically tracked this information |