diff options
| author | Christian Hopps <chopps@labn.net> | 2024-07-23 17:42:07 -0400 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2024-07-23 17:50:33 -0400 |
| commit | be9a6fc0ea8180a4aaa558c5402ea543427e2e7e (patch) | |
| tree | 14ae456978e4ca164ffe6ef83965f92ea1a64db7 /lib/vty.c | |
| parent | f2d5bf7b67801c58a56251a774765d1311c1190b (diff) | |
lib: mgmtd: fix too early daemon detach of mgmtd
Correct FRR startup counts on a daemon's vty socket to be open when the
parent process exits. The parent process waits for `frr_check_detach()`
to be called by the child before exiting. The problem is when the
`FRR_MANUAL_VTY_START` flag is set the vty socket was not opened but
`frr_check_detach()` was called anyway.
Instead add a bool option for `frr_check_detach()` to be called when the
socket is opened with `frr_vty_serv_start()`, and do so when "manually"
calling said function (i.e., when FRR_MANUAL_VTY_START is set).
The `FRR_MANUAL_VTY_START` flag is only set by mgmtd. The reason we
wait to open the vty socket is so that mgmtd can parse the various
daemon specific config files it has taken over, after the event loop has
started, but before we receive any possible new config from `vtysh`.
fixes #16362
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3502,7 +3502,7 @@ static void vty_mgmt_server_connected(struct mgmt_fe_client *client, /* Start or stop listening for vty connections */ if (connected) - frr_vty_serv_start(); + frr_vty_serv_start(true); else frr_vty_serv_stop(); } |
