|
|
3a6d19 |
diff -up nfs-utils-1.3.0/nfs.conf.orig nfs-utils-1.3.0/nfs.conf
|
|
|
3a6d19 |
--- nfs-utils-1.3.0/nfs.conf.orig 2019-03-15 11:06:31.295217191 -0400
|
|
|
3a6d19 |
+++ nfs-utils-1.3.0/nfs.conf 2019-03-15 11:07:37.178172631 -0400
|
|
|
3a6d19 |
@@ -63,6 +63,7 @@
|
|
|
3a6d19 |
# name=
|
|
|
3a6d19 |
# state-directory-path=/var/lib/nfs/statd
|
|
|
3a6d19 |
# ha-callout=
|
|
|
3a6d19 |
+# no-notify=0
|
|
|
3a6d19 |
#
|
|
|
3a6d19 |
#[sm-notify]
|
|
|
3a6d19 |
# debug=0
|
|
|
3a6d19 |
diff -up nfs-utils-1.3.0/utils/statd/statd.c.orig nfs-utils-1.3.0/utils/statd/statd.c
|
|
|
3a6d19 |
--- nfs-utils-1.3.0/utils/statd/statd.c.orig 2019-03-15 11:06:31.244216452 -0400
|
|
|
3a6d19 |
+++ nfs-utils-1.3.0/utils/statd/statd.c 2019-03-15 11:15:33.950086819 -0400
|
|
|
3a6d19 |
@@ -226,7 +226,8 @@ static void set_nlm_port(char *type, int
|
|
|
3a6d19 |
fd = open(pathbuf, O_WRONLY);
|
|
|
3a6d19 |
if (fd < 0 && errno == ENOENT) {
|
|
|
3a6d19 |
/* probably module not loaded */
|
|
|
3a6d19 |
- system("modprobe lockd");
|
|
|
3a6d19 |
+ if (system("modprobe lockd"))
|
|
|
3a6d19 |
+ {/* ignore return value */}
|
|
|
3a6d19 |
fd = open(pathbuf, O_WRONLY);
|
|
|
3a6d19 |
}
|
|
|
3a6d19 |
if (fd >= 0) {
|
|
|
3a6d19 |
@@ -237,6 +238,39 @@ static void set_nlm_port(char *type, int
|
|
|
3a6d19 |
} else
|
|
|
3a6d19 |
fprintf(stderr, "%s: failed to open %s: %m\n", name_p, pathbuf);
|
|
|
3a6d19 |
}
|
|
|
3a6d19 |
+int port = 0, out_port = 0;
|
|
|
3a6d19 |
+int nlm_udp = 0, nlm_tcp = 0;
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+inline static void
|
|
|
3a6d19 |
+read_nfsconf(char **argv)
|
|
|
3a6d19 |
+{
|
|
|
3a6d19 |
+ char *s;
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ conf_init();
|
|
|
3a6d19 |
+ xlog_from_conffile("statd");
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ out_port = conf_get_num("statd", "outgoing-port", out_port);
|
|
|
3a6d19 |
+ port = conf_get_num("statd", "port", port);
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ MY_NAME = conf_get_str("statd", "name");
|
|
|
3a6d19 |
+ if (MY_NAME)
|
|
|
3a6d19 |
+ run_mode |= STATIC_HOSTNAME;
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ s = conf_get_str("statd", "state-directory-path");
|
|
|
3a6d19 |
+ if (s && !nsm_setup_pathnames(argv[0], s))
|
|
|
3a6d19 |
+ exit(1);
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ s = conf_get_str("statd", "ha-callout");
|
|
|
3a6d19 |
+ if (s)
|
|
|
3a6d19 |
+ ha_callout_prog = s;
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ nlm_tcp = conf_get_num("lockd", "port", nlm_tcp);
|
|
|
3a6d19 |
+ /* udp defaults to the same as tcp ! */
|
|
|
3a6d19 |
+ nlm_udp = conf_get_num("lockd", "udp-port", nlm_tcp);
|
|
|
3a6d19 |
+
|
|
|
3a6d19 |
+ if (conf_get_bool("statd", "no-notify", false))
|
|
|
3a6d19 |
+ run_mode |= MODE_NO_NOTIFY;
|
|
|
3a6d19 |
+}
|
|
|
3a6d19 |
|
|
|
3a6d19 |
/*
|
|
|
3a6d19 |
* Entry routine/main loop.
|
|
|
3a6d19 |
@@ -244,11 +278,8 @@ static void set_nlm_port(char *type, int
|
|
|
3a6d19 |
int main (int argc, char **argv)
|
|
|
3a6d19 |
{
|
|
|
3a6d19 |
extern char *optarg;
|
|
|
3a6d19 |
- char *s;
|
|
|
3a6d19 |
int pid;
|
|
|
3a6d19 |
int arg;
|
|
|
3a6d19 |
- int port = 0, out_port = 0;
|
|
|
3a6d19 |
- int nlm_udp = 0, nlm_tcp = 0;
|
|
|
3a6d19 |
struct rlimit rlim;
|
|
|
3a6d19 |
char *env;
|
|
|
3a6d19 |
|
|
|
3a6d19 |
@@ -273,23 +304,8 @@ int main (int argc, char **argv)
|
|
|
3a6d19 |
/* Set hostname */
|
|
|
3a6d19 |
MY_NAME = NULL;
|
|
|
3a6d19 |
|
|
|
3a6d19 |
- conf_init();
|
|
|
3a6d19 |
- xlog_from_conffile("statd");
|
|
|
3a6d19 |
- out_port = conf_get_num("statd", "outgoing-port", out_port);
|
|
|
3a6d19 |
- port = conf_get_num("statd", "port", port);
|
|
|
3a6d19 |
- MY_NAME = conf_get_str("statd", "name");
|
|
|
3a6d19 |
- if (MY_NAME)
|
|
|
3a6d19 |
- run_mode |= STATIC_HOSTNAME;
|
|
|
3a6d19 |
- s = conf_get_str("statd", "state-directory-path");
|
|
|
3a6d19 |
- if (s && !nsm_setup_pathnames(argv[0], s))
|
|
|
3a6d19 |
- exit(1);
|
|
|
3a6d19 |
- s = conf_get_str("statd", "ha-callout");
|
|
|
3a6d19 |
- if (s)
|
|
|
3a6d19 |
- ha_callout_prog = s;
|
|
|
3a6d19 |
-
|
|
|
3a6d19 |
- nlm_tcp = conf_get_num("lockd", "port", nlm_tcp);
|
|
|
3a6d19 |
- /* udp defaults to the same as tcp ! */
|
|
|
3a6d19 |
- nlm_udp = conf_get_num("lockd", "udp-port", nlm_tcp);
|
|
|
3a6d19 |
+ /* Read nfs.conf */
|
|
|
3a6d19 |
+ read_nfsconf(argv);
|
|
|
3a6d19 |
|
|
|
3a6d19 |
/* Process command line switches */
|
|
|
3a6d19 |
while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:LT:U:", longopts, NULL)) != EOF) {
|