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

Feature request, Extra variables passed to scripts #189

Closed
hongkongkiwi opened this issue Aug 19, 2021 · 2 comments
Closed

Feature request, Extra variables passed to scripts #189

hongkongkiwi opened this issue Aug 19, 2021 · 2 comments
Milestone

Comments

@hongkongkiwi
Copy link
Contributor

hongkongkiwi commented Aug 19, 2021

Currently, SERVICE_IDENT is passed to pre and post scripts, this is very helpful.

I would like to propose a few additional variables:

  • SERVICE_ENV_FILE (name and path of env file if passed)
  • SERVICE_ENV_FILE_EXISTS (1 if file exists and was loaded, otherwise 0)
  • SERVICE_TYPE (one of "task","run","service","pre" or "post")
  • SERVICE_CONF_DIR (variable set --with-sysroot during compilation, I think by default this should be "/etc/default:/etc/conf.d")
@troglobit
Copy link
Owner

Thanks, I'll consider it.

@troglobit troglobit added this to the 4.3 milestone Aug 19, 2021
@hongkongkiwi hongkongkiwi changed the title [Suggestion] Extra variables passed to scripts Feature request, Extra variables passed to scripts Aug 22, 2021
troglobit added a commit that referenced this issue Feb 7, 2022
 - SERVICE_TYPE for svc->type
 - SERVICE_SCRIPT_TYPE for pre/post

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
Copy link
Owner

Implemented, with slight change to proposal. SERVICE_TYPE is task/run/service, while SERVICE_SCRIPT_TYPE is pre/post. The SERVICE_CONF_DIR is set to "/etc/default:/etc/conf.d", or "/etc/default:/etc/conf.d:PATH" when --with-sysconfig=PATH is given at configure time.

troglobit added a commit that referenced this issue Apr 14, 2022
Found by Coverity Scan.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
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