mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 22:10:19 +00:00
doc: update watchfrr manpage
Remove -R, -a, -A, -e and -z options. Also remove blocker in the code that refuses to start if --dry is given together with -k / -s / -r. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
b4fa7c95f9
commit
d87ae5cc1a
@ -20,59 +20,6 @@ daemon's VTY UNIX stream socket, and send echo commands to ensure the
|
|||||||
daemon responds. When the daemon crashes, EOF is received from the socket,
|
daemon responds. When the daemon crashes, EOF is received from the socket,
|
||||||
so that watchfrr can react immediately.
|
so that watchfrr can react immediately.
|
||||||
.PP
|
.PP
|
||||||
This program can run in one of the following 5 modes:
|
|
||||||
.TP
|
|
||||||
.B Mode 0: monitor
|
|
||||||
In this mode, the program serves as a monitor and reports status changes.
|
|
||||||
.IP
|
|
||||||
Example usage: watchfrr \-d zebra ospfd bgpd
|
|
||||||
.TP
|
|
||||||
.B Mode 1: global restart
|
|
||||||
In this mode, whenever a daemon hangs or crashes, the given command is used
|
|
||||||
to restart all watched daemons.
|
|
||||||
.IP
|
|
||||||
Example usage: watchfrr \-dz \e
|
|
||||||
.br
|
|
||||||
-R '/sbin/service zebra restart; /sbin/service ospfd restart' \e
|
|
||||||
.br
|
|
||||||
zebra ospfd
|
|
||||||
.TP
|
|
||||||
.B Mode 2: individual daemon restart
|
|
||||||
In this mode, whenever a single daemon hangs or crashes, the given command
|
|
||||||
is used to restart this daemon only.
|
|
||||||
.IP
|
|
||||||
Example usage: watchfrr \-dz \-r '/sbin/service %s restart' \e
|
|
||||||
.br
|
|
||||||
zebra ospfd bgpd
|
|
||||||
.TP
|
|
||||||
.B Mode 3: phased zebra restart
|
|
||||||
In this mode, whenever a single daemon hangs or crashes, the given command
|
|
||||||
is used to restart this daemon only. The only exception is the zebra
|
|
||||||
daemon; in this case, the following steps are taken: (1) all other daemons
|
|
||||||
are stopped, (2) zebra is restarted, and (3) other daemons are started
|
|
||||||
again.
|
|
||||||
.IP
|
|
||||||
Example usage: watchfrr \-adz \-r '/sbin/service %s restart' \e
|
|
||||||
.br
|
|
||||||
\-s '/sbin/service %s start' \e
|
|
||||||
.br
|
|
||||||
\-k '/sbin/service %s stop' zebra ospfd bgpd
|
|
||||||
.TP
|
|
||||||
.B Mode 4: phased global restart for any failure
|
|
||||||
In this mode, whenever a single daemon hangs or crashes, the following
|
|
||||||
steps are taken: (1) all other daemons are stopped, (2) zebra is restarted,
|
|
||||||
and (3) other daemons are started again.
|
|
||||||
.IP
|
|
||||||
Example usage: watchfrr \-Adz \-r '/sbin/service %s restart' \e
|
|
||||||
.br
|
|
||||||
\-s '/sbin/service %s start' \e
|
|
||||||
.br
|
|
||||||
\-k '/sbin/service %s stop' zebra ospfd bgpd
|
|
||||||
.PP
|
|
||||||
Important: It is believed that mode 2 (individual daemon restart) is not
|
|
||||||
safe, and mode 3 (phased zebra restart) may not be safe with certain
|
|
||||||
routing daemons.
|
|
||||||
.PP
|
|
||||||
In order to avoid restarting the daemons in quick succession, you can
|
In order to avoid restarting the daemons in quick succession, you can
|
||||||
supply the
|
supply the
|
||||||
.B \-m
|
.B \-m
|
||||||
@ -87,6 +34,36 @@ the restart delay is set to the value of
|
|||||||
otherwise the interval is doubled (but capped at the value of
|
otherwise the interval is doubled (but capped at the value of
|
||||||
.BR \-M ).
|
.BR \-M ).
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
|
The following 3 options specify scripts that
|
||||||
|
.B watchfrr
|
||||||
|
uses to perform start/stop/restart actions. These options are mandatory
|
||||||
|
unless the
|
||||||
|
.B --dry
|
||||||
|
option is used:
|
||||||
|
.TP
|
||||||
|
.BI \-s " command" "\fR, \fB\-\-start\-command " command
|
||||||
|
Supply a Bourne shell
|
||||||
|
.I command
|
||||||
|
to start a single daemon. The command string should contain the '%s'
|
||||||
|
placeholder to be substituted with the daemon name.
|
||||||
|
.TP
|
||||||
|
.BI \-k " command" "\fR, \fB\-\-kill\-command " command
|
||||||
|
Supply a Bourne shell
|
||||||
|
.I command
|
||||||
|
to stop a single daemon. The command string should contain the '%s'
|
||||||
|
placeholder to be substituted with the daemon name.
|
||||||
|
.TP
|
||||||
|
.BI \-r " command" "\fR, \fB\-\-restart " command
|
||||||
|
Supply a Bourne shell
|
||||||
|
.I command
|
||||||
|
to restart a single daemon. The command string should contain the '%s'
|
||||||
|
placeholder to be substituted with the daemon name.
|
||||||
|
.PP
|
||||||
|
Other options:
|
||||||
|
.TP
|
||||||
|
.BI \-\-dry
|
||||||
|
Run watchfrr in "dry-run" mode, only monitoring the specified daemons but not
|
||||||
|
performing any start/stop/restart actions.
|
||||||
.TP
|
.TP
|
||||||
.BR \-d ", " \-\-daemon
|
.BR \-d ", " \-\-daemon
|
||||||
Run in daemon mode. When supplied, error messages are sent to Syslog
|
Run in daemon mode. When supplied, error messages are sent to Syslog
|
||||||
@ -97,10 +74,6 @@ Set the VTY socket
|
|||||||
.I directory
|
.I directory
|
||||||
(the default value is "/var/run/frr").
|
(the default value is "/var/run/frr").
|
||||||
.TP
|
.TP
|
||||||
.BR \-e ", " \-\-no\-echo
|
|
||||||
Do not ping the daemons to test whether they respond. This option is
|
|
||||||
necessary if one or more daemons do not support the echo command.
|
|
||||||
.TP
|
|
||||||
.BI \-l " level" "\fR, \fB\-\-loglevel " level
|
.BI \-l " level" "\fR, \fB\-\-loglevel " level
|
||||||
Set the logging
|
Set the logging
|
||||||
.I level
|
.I level
|
||||||
@ -131,68 +104,6 @@ Set the restart (kill) timeout in seconds (the default value is "20"). If
|
|||||||
any background jobs are still running after this period has elapsed, they
|
any background jobs are still running after this period has elapsed, they
|
||||||
will be killed.
|
will be killed.
|
||||||
.TP
|
.TP
|
||||||
.BI \-r " command" "\fR, \fB\-\-restart " command
|
|
||||||
Supply a Bourne shell
|
|
||||||
.I command
|
|
||||||
to restart a single daemon. The command string should contain the '%s'
|
|
||||||
placeholder to be substituted with the daemon name.
|
|
||||||
.IP
|
|
||||||
Note that
|
|
||||||
.B \-r
|
|
||||||
and
|
|
||||||
.B \-R
|
|
||||||
options are not compatible.
|
|
||||||
.TP
|
|
||||||
.BI \-s " command" "\fR, \fB\-\-start\-command " command
|
|
||||||
Supply a Bourne shell
|
|
||||||
.I command
|
|
||||||
to start a single daemon. The command string should contain the '%s'
|
|
||||||
placeholder to be substituted with the daemon name.
|
|
||||||
.TP
|
|
||||||
.BI \-k " command" "\fR, \fB\-\-kill\-command " command
|
|
||||||
Supply a Bourne shell
|
|
||||||
.I command
|
|
||||||
to stop a single daemon. The command string should contain the '%s'
|
|
||||||
placeholder to be substituted with the daemon name.
|
|
||||||
.TP
|
|
||||||
.BR \-R ", " \-\-restart\-all
|
|
||||||
When one or more daemons are shut down, try to restart them using the
|
|
||||||
Bourne shell command supplied on the command line.
|
|
||||||
.IP
|
|
||||||
Note that
|
|
||||||
.B \-r
|
|
||||||
and
|
|
||||||
.B \-R
|
|
||||||
options are not compatible.
|
|
||||||
.TP
|
|
||||||
.BR \-z ", " \-\-unresponsive\-restart
|
|
||||||
When a daemon is in an unresponsive state, treat it as being shut down for
|
|
||||||
the restart purposes.
|
|
||||||
.TP
|
|
||||||
.BR \-a ", " \-\-all\-restart
|
|
||||||
When zebra hangs or crashes, restart all daemons taking the following
|
|
||||||
steps: (1) stop all other daemons, (2) restart zebra, and (3) start other
|
|
||||||
daemons again.
|
|
||||||
.IP
|
|
||||||
Note that this option also requires
|
|
||||||
.BR \-r ,
|
|
||||||
.BR \-s ,
|
|
||||||
and
|
|
||||||
.B \-k
|
|
||||||
options to be specified.
|
|
||||||
.TP
|
|
||||||
.BR \-A ", " \-\-always\-all\-restart
|
|
||||||
When any daemon (i.e., not just zebra) hangs or crashes, restart all
|
|
||||||
daemons taking the following steps: (1) stop all other daemons, (2) restart
|
|
||||||
zebra, and (3) start other daemons again.
|
|
||||||
.IP
|
|
||||||
Note that this option also requires
|
|
||||||
.BR \-r ,
|
|
||||||
.BR \-s ,
|
|
||||||
and
|
|
||||||
.B \-k
|
|
||||||
options to be specified.
|
|
||||||
.TP
|
|
||||||
.BI \-p " filename" "\fR, \fB\-\-pid\-file " filename
|
.BI \-p " filename" "\fR, \fB\-\-pid\-file " filename
|
||||||
Set the process identifier
|
Set the process identifier
|
||||||
.I filename
|
.I filename
|
||||||
@ -204,9 +115,8 @@ When the supplied
|
|||||||
is found in any of the command line option arguments (i.e.,
|
is found in any of the command line option arguments (i.e.,
|
||||||
.BR \-r ,
|
.BR \-r ,
|
||||||
.BR \-s ,
|
.BR \-s ,
|
||||||
.BR \-k ,
|
|
||||||
or
|
or
|
||||||
.BR \-R ),
|
.BR \-k ),
|
||||||
replace it with a space.
|
replace it with a space.
|
||||||
.IP
|
.IP
|
||||||
This is an ugly hack to circumvent problems with passing the command line
|
This is an ugly hack to circumvent problems with passing the command line
|
||||||
|
@ -1107,9 +1107,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (watch_only
|
if (watch_only
|
||||||
&& (gs.start_command || gs.stop_command || gs.restart_command)) {
|
&& (gs.start_command || gs.stop_command || gs.restart_command)) {
|
||||||
fputs("Options -r/-s/-k make no sense combined with -D.\n",
|
fputs("Options -r/-s/-k are not used when --dry is active.\n",
|
||||||
stderr);
|
stderr);
|
||||||
frr_help_exit(1);
|
|
||||||
}
|
}
|
||||||
if (!watch_only
|
if (!watch_only
|
||||||
&& (!gs.restart_command || !gs.start_command || !gs.stop_command)) {
|
&& (!gs.restart_command || !gs.start_command || !gs.stop_command)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user