struct thread *t_write;
struct daemon *next;
struct restart_info restart;
+
+ /*
+ * For a given daemon, if we've turned on ignore timeouts
+ * ignore the timeout value and assume everything is ok
+ * This is for daemon debugging w/ gdb after we have started
+ * FRR and realize we have something that needs to be looked
+ * at
+ */
+ bool ignore_timeout;
};
#define OPTION_MINRESTART 2000
static void restart_done(struct daemon *dmn);
static const char *progname;
+
+void watchfrr_set_ignore_daemon(struct vty *vty, const char *dname, bool ignore)
+{
+ struct daemon *dmn;
+
+ for (dmn = gs.daemons; dmn; dmn = dmn->next) {
+ if (strncmp(dmn->name, dname, strlen(dmn->name)) == 0)
+ break;
+ }
+
+ if (dmn) {
+ dmn->ignore_timeout = ignore;
+ vty_out(vty, "%s switching to %s\n", dmn->name,
+ ignore ? "ignore" : "watch");
+ } else
+ vty_out(vty, "%s is not configured for running at the moment",
+ dname);
+}
+
static void printhelp(FILE *target)
{
fprintf(target,
dmn->t_wakeup = NULL;
dmn->state = DAEMON_UNRESPONSIVE;
+ if (dmn->ignore_timeout)
+ return 0;
flog_err(EC_WATCHFRR_CONNECTION,
"%s state -> unresponsive : no response yet to ping "
"sent %ld seconds ago",
(long)gs.restart.pid);
for (dmn = gs.daemons; dmn; dmn = dmn->next) {
- vty_out(vty, " %-20s %s\n", dmn->name, state_str[dmn->state]);
+ vty_out(vty, " %-20s %s%s", dmn->name, state_str[dmn->state],
+ dmn->ignore_timeout ? "/Ignoring Timeout\n" : "\n");
if (dmn->restart.pid)
vty_out(vty, " restart running, pid %ld\n",
(long)dmn->restart.pid);
return CMD_SUCCESS;
}
+#ifndef VTYSH_EXTRACT_PL
+#include "watchfrr/watchfrr_vty_clippy.c"
+#endif
+
+DEFPY (watchfrr_ignore_daemon,
+ watchfrr_ignore_daemon_cmd,
+ "[no] watchfrr ignore DAEMON$dname",
+ NO_STR
+ "Watchfrr Specific sub-command\n"
+ "Ignore a specified daemon when it does not respond to echo request\n"
+ "The daemon to ignore\n")
+{
+ watchfrr_set_ignore_daemon(vty, dname, no ? false : true );
+
+ return CMD_SUCCESS;
+}
+
void integrated_write_sigchld(int status)
{
uint8_t reply[4] = {0, 0, 0, CMD_WARNING};
integrated_write_pid = -1;
install_element(ENABLE_NODE, &config_write_integrated_cmd);
install_element(ENABLE_NODE, &show_debugging_watchfrr_cmd);
+
+ install_element(ENABLE_NODE, &watchfrr_ignore_daemon_cmd);
+
install_element(CONFIG_NODE, &show_debugging_watchfrr_cmd);
install_element(VIEW_NODE, &show_watchfrr_cmd);
}