summaryrefslogtreecommitdiff
path: root/staticd
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-03-31 16:34:49 +0000
committerChristian Hopps <chopps@labn.net>2023-04-01 18:06:43 -0400
commit8033bf3976d85c84f00a3ab320eca5fc8418d756 (patch)
tree945221853843902b26bb0ba00facc01dae628ad7 /staticd
parent803829e41e129ba2ea1b519a665c8732777e2008 (diff)
mgmtd: lib: read transitioned daemons split config files in mgmtd
When daemons transition to mgmtd they should stop reading their split config files, and let mgmtd do that, otherwise things can get out of sync. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/staticd/static_main.c b/staticd/static_main.c
index 09f22318ff..9809d9751a 100644
--- a/staticd/static_main.c
+++ b/staticd/static_main.c
@@ -161,6 +161,10 @@ static const struct frr_yang_module_info *const staticd_yang_modules[] = {
#define STATIC_VTY_PORT 2616
+/*
+ * NOTE: .flags == FRR_NO_SPLIT_CONFIG to avoid reading split config, mgmtd will
+ * do this for us now
+ */
FRR_DAEMON_INFO(staticd, STATIC, .vty_port = STATIC_VTY_PORT,
.proghelp = "Implementation of STATIC.",
@@ -170,7 +174,8 @@ FRR_DAEMON_INFO(staticd, STATIC, .vty_port = STATIC_VTY_PORT,
.privs = &static_privs, .yang_modules = staticd_yang_modules,
.n_yang_modules = array_size(staticd_yang_modules),
-);
+
+ .flags = FRR_NO_SPLIT_CONFIG);
int main(int argc, char **argv, char **envp)
{
@@ -210,9 +215,12 @@ int main(int argc, char **argv, char **envp)
routing_control_plane_protocols_register_vrf_dependency();
- snprintf(backup_config_file, sizeof(backup_config_file),
- "%s/zebra.conf", frr_sysconfdir);
- staticd_di.backup_config_file = backup_config_file;
+ /*
+ * We set FRR_NO_SPLIT_CONFIG flag to avoid reading our config, but we
+ * still need to write one if vtysh tells us to. Setting the host
+ * config filename does this.
+ */
+ host_config_set(config_default);
frr_config_fork();
frr_run(master);