Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: mgmtd: fix too early daemon detach of mgmtd #16451

Merged

Conversation

choppsv1
Copy link
Contributor

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

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 FRRouting#16362

Signed-off-by: Christian Hopps <chopps@labn.net>
@choppsv1
Copy link
Contributor Author

https://github.com/Mergifyio backport dev/10.1 stable/10.0

Copy link

mergify bot commented Jul 24, 2024

backport dev/10.1 stable/10.0

✅ Backports have been created

@donaldsharp donaldsharp merged commit 5bb0b01 into FRRouting:master Jul 24, 2024
16 checks passed
ton31337 added a commit that referenced this pull request Jul 25, 2024
lib: mgmtd: fix too early daemon detach of mgmtd (backport #16451)
ton31337 added a commit that referenced this pull request Jul 25, 2024
lib: mgmtd: fix too early daemon detach of mgmtd (backport #16451)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mgmtd: FRR_MANUAL_VTY_START flag leads to startup race condition
2 participants