summaryrefslogtreecommitdiffstats
path: root/utils/statd/statd.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2016-12-06 12:59:50 -0500
committerSteve Dickson <steved@redhat.com>2016-12-20 13:29:04 -0500
commit4f7f7bcbb9c5a35ece2f7ba3a1ca217585ee856c (patch)
tree45dffe2c69e1d53135993add127c9328502c511d /utils/statd/statd.c
parent36b268c6f3bc807ecf4f59ff64eea663146fba4b (diff)
downloadnfs-utils-4f7f7bcbb9c5a35ece2f7ba3a1ca217585ee856c.tar.gz
nfs-utils-4f7f7bcbb9c5a35ece2f7ba3a1ca217585ee856c.tar.xz
nfs-utils-4f7f7bcbb9c5a35ece2f7ba3a1ca217585ee856c.zip
Add /etc/nfs.conf support for statd
Some options appear in the [lockd] section. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/statd/statd.c')
-rw-r--r--utils/statd/statd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/statd/statd.c b/utils/statd/statd.c
index 15f2b18..5f4ad79 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) {