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

librc, rc, supervise-daemon: Repace hardcoded paths with function calls. #752

Merged
merged 2 commits into from
Oct 26, 2024

Conversation

navi-desu
Copy link
Member

This lays the groundwork for other features like user services, or a different root prefix, by allowing us to change where openrc looks up for files at runtime.

As a side effect of this change, now all sysconfdirs (aka RC_PKG_PREFIX and RC_LOCAL_PREFIX) are checked for configuration files (rc.conf and rc.conf.d).

This is the first of three patches for openrc-user support.

I am unsure about the api for rc_sysconf_dir, however, an RC_STRINGLIST would be more idiomatic to the codebase, but at the same time, the current NULL terminated double pointer allows for avoiding allocations when not necessary

@navi-desu navi-desu force-pushed the dynamic-paths branch 2 times, most recently from 089f500 to 0a520f8 Compare September 21, 2024 15:34
@navi-desu
Copy link
Member Author

removed the side effect of the change, now only the sysconfdir is checked like before.

also renamed the new api functions to be more inline with how we name directory variables.

rc_scriptdirs() holds a null terminated list of strings to the base directories that init.d and conf.d exist (PKG_PREFIX, SYSCONFDIR, LOCAL_PREFIX)
rc_sysconfdir() returns the directory where to load rc.conf (and profile.env) from, SYSCONFDIR
rc_runleveldir(), the runlevels
rc_svcdir(), the service directory where state is kept

This lays the groundwork for other features like user services, or
a different root prefix, by allowing us to change where openrc looks up
for files at runtime.
@navi-desu navi-desu merged commit 5d186b3 into master Oct 26, 2024
8 checks passed
@navi-desu navi-desu deleted the dynamic-paths branch October 26, 2024 18:24
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

Successfully merging this pull request may close these issues.

1 participant