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

Respect $HOME/tilde expansion in rc.conf file paths #776

Open
sevmonster opened this issue Feb 15, 2025 · 2 comments
Open

Respect $HOME/tilde expansion in rc.conf file paths #776

sevmonster opened this issue Feb 15, 2025 · 2 comments
Assignees

Comments

@sevmonster
Copy link

With user mode, it would be helpful to parse the $HOME parameter and/or do tilde (~) expansion in rc.conf, at the very least. This would be useful for setting e.g. rc_log_dir="$HOME/.var/log" in a shared config file that could then be linked in all users' OpenRC directories. Without this feature, the config file must be customized for each individual user.

It would be helpful to parse all parameters, not just $HOME, but I don't see that as being superbly useful. Maybe parsing the XDG parameters would be good, since $XDG_RUNTIME_DIR is actually used by OpenRC.

I was actually under the impression this did work at first, since when rc.conf gets sourced by shells, it does expand parameters as expected. However, all the C-side functions I read through that parse values from rc.conf do not do any shell expansion. Due to this, you can have a single config file that has properties with two different values depending on how the file was initially loaded.

@navi-desu
Copy link
Member

this sounds like a good idea. we could use wordexp on the c side to perform shell-like expansions easily.

@navi-desu navi-desu self-assigned this Feb 22, 2025
@navi-desu
Copy link
Member

there's one kinda major issue though, env_filter needs the config, and we shouldn't expand envs before filtering them... hmm...

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

2 participants