]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Add ability to retry if backup is specified
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 May 2018 01:01:15 +0000 (21:01 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Jun 2018 12:43:59 +0000 (08:43 -0400)
If we fail to read in the config file and we have
specified a backup of the backup, attempt to
read that information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/libfrr.c
lib/libfrr.h

index 88203fbeb6bb57e424d5a1a2a5bfbd7db0d78fd2..4620cb25862ec8812e73c11ce87d7e5be6be5b2d 100644 (file)
@@ -725,7 +725,12 @@ void frr_config_fork(void)
 {
        hook_call(frr_late_init, master);
 
-       vty_read_config(di->config_file, config_default);
+       if (!vty_read_config(di->config_file, config_default) &&
+           di->backup_config_file) {
+               zlog_info("Attempting to read backup config file: %s specified",
+                         di->backup_config_file);
+               vty_read_config(di->backup_config_file, config_default);
+       }
 
        /* Don't start execution if we are in dry-run mode */
        if (di->dryrun)
index 7ffa780bfb9a75d8d6316a0b73d564d9399650d4..bd572cce1b2b1e920b5ec2f43061c2221c06692e 100644 (file)
@@ -51,6 +51,7 @@ struct frr_daemon_info {
        bool daemon_mode;
        bool terminal;
        const char *config_file;
+       const char *backup_config_file;
        const char *pid_file;
        const char *vty_path;
        const char *module_path;