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

service environment variables are not expanded when sourced #377

Closed
az143 opened this issue Oct 23, 2023 · 2 comments
Closed

service environment variables are not expanded when sourced #377

az143 opened this issue Oct 23, 2023 · 2 comments
Assignees
Milestone

Comments

@az143
Copy link

az143 commented Oct 23, 2023

when setting up an /etc/default/somesvc, it is currently not possible to reference variables defined earlier, because
source_env() only strips undesirable bits before calling setenv().

for example, this construction doesn't work:

RUNDIR=/var/run/somesvc
DAEMON_ARGS=--workdir $RUNDIR --other-args...

i think that running wordexp() before the setenv() calls would remove this limitation; if that's not true,
then the limitation should be mentioned in doc/config.md and man/finit.conf.5.

@az143
Copy link
Author

az143 commented Oct 24, 2023

see pr #379

@troglobit
Copy link
Owner

A wordexp() of the value (in key=value) is probably the way to go here. It fits with the principle of least surprise, does not leak to other processes, and would also keep the documentation to a minimum.

@troglobit troglobit added this to the 4.5 milestone Oct 30, 2023
@troglobit troglobit self-assigned this Oct 30, 2023
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