frr_daemon_wait(fds[0]);
}
-void frr_config_fork(void)
+/*
+ * Why is this a thread?
+ *
+ * The read in of config for integrated config happens *after*
+ * thread execution starts( because it is passed in via a vtysh -b -n )
+ * While if you are not using integrated config we want the ability
+ * to read the config in after thread execution starts, so that
+ * we can match this behavior.
+ */
+static int frr_config_read_in(struct thread *t)
{
- hook_call(frr_late_init, master);
-
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);
}
+ return 0;
+}
+
+void frr_config_fork(void)
+{
+ hook_call(frr_late_init, master);
/* Don't start execution if we are in dry-run mode */
- if (di->dryrun)
+ if (di->dryrun) {
+ frr_config_read_in(NULL);
exit(0);
+ }
+
+ thread_add_event(master, frr_config_read_in, NULL, 0, &di->read_in);
if (di->daemon_mode || di->terminal)
frr_daemonize();