From: NeilBrown <neilb@suse.com>
To: "J. Bruce Fields" <bfields@redhat.com>,
Steve Dickson <SteveD@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 05/15] Add /etc/nfs.conf support for statd
Date: Fri, 02 Dec 2016 14:58:28 +1100 [thread overview]
Message-ID: <148065110872.28046.13166174517415675834.stgit@noble> (raw)
In-Reply-To: <148065078775.28046.5506130555300891075.stgit@noble>
Some options appear in the [lockd] section.
Signed-off-by: NeilBrown <neilb@suse.com>
---
systemd/nfs.conf.man | 25 +++++++++++++++++++++++++
utils/statd/statd.c | 20 ++++++++++++++++++++
utils/statd/statd.man | 35 +++++++++++++++++++++++++++++++++--
3 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
index 9fe9d0eff1fc..a1121e46ef5e 100644
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -118,6 +118,31 @@ section, are used to configure mountd. See
.BR rpc.mountd (8)
for details.
+.TP
+.B statd
+Recognized values:
+.BR port ,
+.BR outgoing-port ,
+.BR name ,
+.BR state-directory-path ,
+.BR ha-callout .
+
+See
+.BR rpc.statd (8)
+for details.
+
+.TP
+.B lockd
+Recognized values:
+.B port
+and
+.BR udp-port .
+
+See
+.BR rpc.statd (8)
+for details.
+
+
.SH FILES
.I /etc/nfs.conf
.SH SEE ALSO
diff --git a/utils/statd/statd.c b/utils/statd/statd.c
index 15f2b18d104d..5f4ad79e6bf3 100644
--- a/utils/statd/statd.c
+++ b/utils/statd/statd.c
@@ -26,6 +26,7 @@
#include <sys/wait.h>
#include <grp.h>
+#include "conffile.h"
#include "statd.h"
#include "nfslib.h"
#include "nfsrpc.h"
@@ -36,6 +37,7 @@
#include <sys/socket.h>
int run_mode = 0; /* foreground logging mode */
+char *conf_path = NFS_CONFFILE;
/* LH - I had these local to main, but it seemed silly to have
* two copies of each - one in main(), one static in log.c...
@@ -242,6 +244,7 @@ static void set_nlm_port(char *type, int port)
int main (int argc, char **argv)
{
extern char *optarg;
+ char *s;
int pid;
int arg;
int port = 0, out_port = 0;
@@ -266,6 +269,23 @@ int main (int argc, char **argv)
/* Set hostname */
MY_NAME = NULL;
+ conf_init();
+ out_port = conf_get_num("statd", "outgoing-port", out_port);
+ port = conf_get_num("statd", "port", port);
+ MY_NAME = conf_get_str("statd", "name");
+ if (MY_NAME)
+ run_mode |= STATIC_HOSTNAME;
+ s = conf_get_str("statd", "state-directory-path");
+ if (s && !nsm_setup_pathnames(argv[0], s))
+ exit(1);
+ s = conf_get_str("statd", "ha-callout");
+ if (s)
+ ha_callout_prog = s;
+
+ nlm_tcp = conf_get_num("lockd", "port", nlm_tcp);
+ /* udp defaults to the same as tcp ! */
+ nlm_udp = conf_get_num("lockd", "udp-port", nlm_tcp);
+
/* Process command line switches */
while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:LT:U:", longopts, NULL)) != EOF) {
switch (arg) {
diff --git a/utils/statd/statd.man b/utils/statd/statd.man
index 1e5520c6dfea..91c260f1bf5e 100644
--- a/utils/statd/statd.man
+++ b/utils/statd/statd.man
@@ -8,7 +8,7 @@
.\" Rewritten by Chuck Lever <chuck.lever@oracle.com>, 2009.
.\" Copyright 2009 Oracle. All rights reserved.
.\"
-.TH RPC.STATD 8 "1 November 2009
+.TH RPC.STATD 8 "1 November 2009"
.SH NAME
rpc.statd \- NSM service daemon
.SH SYNOPSIS
@@ -247,7 +247,7 @@ should listen on for
.B NLM
requests.
.TP
-.BI "\-P, " "" \-\-state\-directory\-path " pathname
+.BI "\-P, " "" \-\-state\-directory\-path " pathname"
Specifies the pathname of the parent directory
where NSM state information resides.
If this option is not specified,
@@ -267,6 +267,37 @@ Causes
to display version information on
.I stderr
and then exit.
+.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 [statd]
+or, in some cases, the
+.B [lockd]
+sections of the
+.I /etc/nfs.conf
+configuration file.
+Values recognized in the
+.B [statd]
+section include
+.BR port ,
+.BR outgoing-port ,
+.BR name ,
+.BR state-directory-path ", and"
+.B ha-callout
+which each have the same effect as the option with the same name.
+
+The values recognized in the
+.B [lockd]
+section include
+.B port
+and
+.B udp-port
+which have the same effect as the
+.B --nlm-port
+and
+.B --nlm-udp-port
+options, respectively.
+
.SH SECURITY
The
.B rpc.statd
next prev parent reply other threads:[~2016-12-02 3:59 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 3:58 [RFC PATCH 00/15] Enhance /etc/nfs.conf usage and remove nfs-config.service NeilBrown
2016-12-02 3:58 ` [PATCH 04/15] Add /etc/nfs.conf support for mountd NeilBrown
2016-12-02 3:58 ` [PATCH 02/15] conffile: add bool support NeilBrown
2016-12-02 3:58 ` NeilBrown [this message]
2016-12-02 3:58 ` [PATCH 01/15] Add man-page describing /etc/nfs.conf NeilBrown
2016-12-02 3:58 ` [PATCH 03/15] Add /etc/nfs.conf support to rpc.nfsd NeilBrown
2016-12-05 22:27 ` J. Bruce Fields
2016-12-05 22:42 ` NeilBrown
2016-12-06 17:52 ` Steve Dickson
2016-12-06 22:30 ` NeilBrown
2016-12-07 14:34 ` Steve Dickson
2016-12-06 18:51 ` Steve Dickson
2016-12-06 22:36 ` NeilBrown
2016-12-07 14:44 ` Steve Dickson
2016-12-07 18:08 ` J. Bruce Fields
2016-12-07 23:14 ` NeilBrown
2016-12-08 0:38 ` Steve Dickson
2016-12-09 22:43 ` J. Bruce Fields
2016-12-20 23:22 ` NeilBrown
2016-12-21 1:55 ` J. Bruce Fields
2016-12-02 3:58 ` [PATCH 11/15] conffile: ignore setting of empty string NeilBrown
2016-12-02 3:58 ` [PATCH 06/15] Add /etc/nfs.conf support for sm-notify NeilBrown
2016-12-02 3:58 ` [PATCH 08/15] conffile: split loading of file into a separate function NeilBrown
2016-12-02 3:58 ` [PATCH 10/15] conffile: strip "quotes" from values in conf file NeilBrown
2016-12-02 3:58 ` [PATCH 07/15] conffile: free image of config file after parsing NeilBrown
2016-12-02 3:58 ` [PATCH 09/15] conffile: add support for include files NeilBrown
2016-12-02 3:58 ` [PATCH 12/15] conffile: allow $name expansion of tag values NeilBrown
2016-12-02 3:58 ` [PATCH 13/15] statd: allow --no-notify to be passed via environment variable NeilBrown
2016-12-02 3:58 ` [PATCH 15/15] Add nfs.systemd man page NeilBrown
2016-12-02 3:58 ` [PATCH 14/15] systemd: Remove the nfs-config.service NeilBrown
2016-12-02 15:56 ` [RFC PATCH 00/15] Enhance /etc/nfs.conf usage and remove nfs-config.service J. Bruce Fields
2016-12-06 16:55 ` Steve Dickson
2016-12-06 22:38 ` NeilBrown
2016-12-07 14:24 ` Steve Dickson
2016-12-06 17:26 ` J. Bruce Fields
2016-12-06 22:47 ` NeilBrown
2016-12-07 14:19 ` J. Bruce Fields
2016-12-06 19:25 ` Steve Dickson
2016-12-06 22:51 ` NeilBrown
2016-12-07 14:21 ` Steve Dickson
2016-12-20 18:33 ` Steve Dickson
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=148065110872.28046.13166174517415675834.stgit@noble \
--to=neilb@suse.com \
--cc=SteveD@redhat.com \
--cc=bfields@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/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