diff options
author | NeilBrown <neilb@suse.com> | 2016-12-06 13:02:00 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-12-20 13:29:04 -0500 |
commit | a834c67ad9eecfbccd068c4917345499f6c911a7 (patch) | |
tree | 7d4a5c84b542dc359b6acc626a2c9257f5c0e8d9 | |
parent | 4f7f7bcbb9c5a35ece2f7ba3a1ca217585ee856c (diff) | |
download | nfs-utils-a834c67ad9eecfbccd068c4917345499f6c911a7.tar.gz nfs-utils-a834c67ad9eecfbccd068c4917345499f6c911a7.tar.xz nfs-utils-a834c67ad9eecfbccd068c4917345499f6c911a7.zip |
Add /etc/nfs.conf support for sm-notify
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | systemd/nfs.conf.man | 10 | ||||
-rw-r--r-- | utils/statd/sm-notify.c | 11 | ||||
-rw-r--r-- | utils/statd/sm-notify.man | 27 |
3 files changed, 48 insertions, 0 deletions
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man index a1121e4..726f603 100644 --- a/systemd/nfs.conf.man +++ b/systemd/nfs.conf.man @@ -142,6 +142,16 @@ See .BR rpc.statd (8) for details. +.TP +.B sm-notify +Recognized values: +.BR retry-time , +.BR outgoing-port ", and" +.BR outgoing-addr . + +See +.BR sm-notify (8) +for details. .SH FILES .I /etc/nfs.conf diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c index 8afddd9..19f40af 100644 --- a/utils/statd/sm-notify.c +++ b/utils/statd/sm-notify.c @@ -29,6 +29,7 @@ #include <errno.h> #include <grp.h> +#include "conffile.h" #include "sockaddr.h" #include "xlog.h" #include "nsm.h" @@ -66,6 +67,7 @@ static _Bool opt_update_state = true; static unsigned int opt_max_retry = 15 * 60; static char * opt_srcaddr = NULL; static char * opt_srcport = NULL; +char * conf_path = NFS_CONFFILE; static void notify(const int sock); static int notify_host(int, struct nsm_host *); @@ -479,6 +481,7 @@ main(int argc, char **argv) { int c, sock, force = 0; char * progname; + char * s; progname = strrchr(argv[0], '/'); if (progname != NULL) @@ -486,6 +489,14 @@ main(int argc, char **argv) else progname = argv[0]; + conf_init(); + opt_max_retry = conf_get_num("sm-notify", "retry-time", opt_max_retry / 60) * 60; + opt_srcport = conf_get_str("sm-notify", "outgoing-port"); + opt_srcaddr = conf_get_str("sm-notify", "outgoing-addr"); + s = conf_get_str("statd", "state-directory-path"); + if (s && !nsm_setup_pathnames(argv[0], s)) + exit(1); + while ((c = getopt(argc, argv, "dm:np:v:P:f")) != -1) { switch (c) { case 'f': diff --git a/utils/statd/sm-notify.man b/utils/statd/sm-notify.man index 7a1cbfa..bb7f6e0 100644 --- a/utils/statd/sm-notify.man +++ b/utils/statd/sm-notify.man @@ -219,6 +219,33 @@ argument when sending SM_NOTIFY requests. .IP This option can be useful in multi-homed configurations where the remote requires notification from a specific network address. +.SH CONFIGURATION FILE +Many of the options that can be set on the command line can also be +controlled through values set in the +.B [sm-notify] +or, in one case, the +.B [statd] +section of the +.I /etc/nfs.conf +configuration file. + +Values recognized in the +.B [sm-notify] +section include: +.BR retry-time , +.BR outgoing-port ", and" +.BR outgoing-addr . +These have the same effect as the command line options +.BR m , +.BR p ", and" +.B v +respectively. + +The value recognized in the +.B [statd] +section is +.BR state-directory-path . + .SH SECURITY The .B sm-notify |