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

Run rc.local and runparts in separate thread #356

Closed
troglobit opened this issue May 21, 2023 · 2 comments
Closed

Run rc.local and runparts in separate thread #356

troglobit opened this issue May 21, 2023 · 2 comments
Assignees
Milestone

Comments

@troglobit
Copy link
Owner

troglobit commented May 21, 2023

When Finit calls /etc/rc.local or scripts in ruparts DIR it is still in runlevel S. This currently means the big state machine has not yet been launched and any API calls from these scripts via initctl may block the boot indefinitely.

As a workaround, 5db2fb2 adds support for initctl -f to bypass native service check.

A better approach would be to fork off a child, finalize bootstrap, where these scripts are called. Finit main could then sit in its event loop, processing API calls and waiting for the scripts to finalize (or time out as they do today) before transitioning to runlevel 2.

@JackNewman12
Copy link
Contributor

Nice! I think this might fix an issue I have seen recently.
One of the devices running finit performed all of its networking setup in runparts on boot.
However this device has 15 network interfaces and by the time finit regains control the net/ conditions get into an incorrect state having missing interface up/down conditions.

No idea why the socket for monitoring the interface changes doesn't report an error, but over 100 changes are pending and all the extra just go missing.

We resolved it by running the networking setup as a task after the system boots up.

@troglobit
Copy link
Owner Author

Yeah this was probably the root cause. I'm working in fixing the same problem also for run statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants