lib: mgmtd: fix too early daemon detach of mgmtd #16451
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theFRR_MANUAL_VTY_START
flag is set the vty socket was not opened butfrr_check_detach()
was called anyway.Instead add a bool option for
frr_check_detach()
to be called when the socket is opened withfrr_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 fromvtysh
.fixes #16362