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

dynamically adding init services from boot #670

Open
fariouche opened this issue Nov 12, 2023 · 4 comments
Open

dynamically adding init services from boot #670

fariouche opened this issue Nov 12, 2023 · 4 comments
Assignees

Comments

@fariouche
Copy link

Hello,
I have a script that runs in sysinit runlevel that scans for available network interfaces (especially wlan) and create various configs, including the symlink in init.d
It then add the interfaces to the boot runlevel.

The reason is that I use the same binary installation (gentoo) on multiple hardwares, and I would like to avoid to create all the possible symlinks in /etc/init.d/net.* even if the interface does not exist.

My question is just to know if running "rc-update add boot net.wlan1", for example, from inside the sysinit runlevel will not trigger any side effects?
So far i do not see any problem, but maybe I will run into more subtle issues?

Thanks!

@fariouche
Copy link
Author

actually it does not work. for some reason, the service is added to the boot runlevel, but is not run when the boot runlevel is executed. (except if I reboot of course)
however, the script is property executed if it is a dependency of an other script that is already in the boot runlevel

@fariouche
Copy link
Author

a call to rc-update -u after the files are created and added seems to fix the issue

@mingzym
Copy link
Contributor

mingzym commented Dec 15, 2023

nice trick, would be great if we can have this trick write down in wiki or other docs.

@navi-desu
Copy link
Member

navi-desu commented Sep 22, 2024

if i get to implement #749, you'd be able to do depend() { need net.$iface } on a service, and that symlink would be made automatically

@navi-desu navi-desu self-assigned this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants