{ "state-directory-path", 1, 0, 'P' },
{ "notify-mode", 0, 0, 'N' },
{ "ha-callout", 1, 0, 'H' },
+ { "no-notify", 0, 0, 'L' },
{ NULL, 0, 0, 0 }
};
fprintf(stderr," -n, --name Specify a local hostname.\n");
fprintf(stderr," -P State directory path.\n");
fprintf(stderr," -N Run in notify only mode.\n");
+ fprintf(stderr," -L, --no-notify Do not perform any notification.\n");
fprintf(stderr," -H Specify a high-availability callout program.\n");
}
MY_NAME = NULL;
/* Process command line switches */
- while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:", longopts, NULL)) != EOF) {
+ while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:L", longopts, NULL)) != EOF) {
switch (arg) {
case 'V': /* Version */
case 'v':
case 'N':
run_mode |= MODE_NOTIFY_ONLY;
break;
+ case 'L': /* Listen only */
+ run_mode |= MODE_NO_NOTIFY;
+ break;
case 'd': /* No daemon only - log to stderr */
run_mode |= MODE_LOG_STDERR;
break;
create_pidfile();
atexit(truncate_pidfile);
- switch (pid = fork()) {
- case 0:
- run_sm_notify(out_port);
- break;
- case -1:
- break;
- default:
- waitpid(pid, NULL, 0);
- }
+ if (! (run_mode & MODE_NO_NOTIFY))
+ switch (pid = fork()) {
+ case 0:
+ run_sm_notify(out_port);
+ break;
+ case -1:
+ break;
+ default:
+ waitpid(pid, NULL, 0);
+ }
drop_privs();
* responding to SM_SIMU_CRASH is an important use cases to
* get perfect.
*/
- switch (pid = fork()) {
- case 0:
- run_sm_notify(out_port);
- break;
- case -1:
- break;
- default:
- waitpid(pid, NULL, 0);
- }
+ if (! (run_mode & MODE_NO_NOTIFY))
+ switch (pid = fork()) {
+ case 0:
+ run_sm_notify(out_port);
+ break;
+ case -1:
+ break;
+ default:
+ waitpid(pid, NULL, 0);
+ }
+
}
return 0;
}
.SH NAME
rpc.statd \- NSM status monitor
.SH SYNOPSIS
-.B "rpc.statd [-F] [-d] [-?] [-n " name "] [-o " port "] [-p " port "] [-H " prog "] [-V]"
+.B "rpc.statd [-FNL] [-d] [-?] [-n " name "] [-o " port "] [-p " port "] [-H " prog "] [-V]"
.SH DESCRIPTION
The
.B rpc.statd
.B rpc.statd
creates a file in
.BR /var/lib/nfs/sm .
-When starting, it iterates through these files and notifies the
+When starting, it normally runs
+.B sm-notify
+to iterate through these files and notify the
peer
.B rpc.statd
on those machines.
statd program will check its state directory, send notifications to any
monitored nodes, and exit once the notifications have been sent. This mode is
used to enable Highly Available NFS implementations (i.e. HA-NFS).
+This mode is deprecated \-
+.B sm-notify
+should be used directly instead.
+.TP
+.BR -L , " --no-notify
+Inhibits the running of
+.BR sm-notify .
+If
+.B sm-notify
+is run by some other script at boot time, there is no need for
+.B statd
+to start sm-notify itself. This can be appropriate if starting of
+statd needs to be delayed until it is actually need. In such cases
+.B sm-notify
+should still be run at boot time.
.TP
.BI "\-H, " "" " \-\-ha-callout " prog
Specify a high availability callout program, which will receive callouts