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

pass options through env_vars if no control over init files #530

Merged
merged 9 commits into from
Mar 1, 2021

Conversation

anarcat
Copy link

@anarcat anarcat commented Feb 23, 2021

The logic here is that if init_style is non, then we have no control
over the init files themselves except through the environment
file.

Typically, the way this works is there is a ARGS environment variable
that gets sucked into the systemd unit file (or the sysv init file).

followup to #32, replacement for #528, based on top of #529

@anarcat anarcat changed the title WIP: No init env options pass options through env_vars if no control over init files Feb 23, 2021
@anarcat anarcat force-pushed the no-init-env-options branch from 834f599 to 809b5bb Compare February 23, 2021 22:19
@anarcat
Copy link
Author

anarcat commented Feb 23, 2021

okay, now that #529 is fixed, i think this is more ready for review, and a good replacement for the even more hackish #528. now we don't allow env_vars (which don't really do anything in most cases) and instead use them to pass options only in some narrow use cases (init_style=none and install_method=package).

as others (@ekohl) have said, this might be better refactored so that we drop support for upstart and sysv style inits, so that the code paths are clearer here. but in the meantime, this is a good stopgap measure to make it possible to run this module against debian package installs (#32).

For some reason, the node exporter unit test checks for the
inexistence of the bird_exporter config file. Naturally, it doesn't
find it (why would it?).

I suspect this is an artifact of a copy-paste from the bird exporter,
and what was really meant here was to check for the inexistence of the
node exporter config file.
The logic here is that if init_style is non, then we have no control
over the init files themselves *except* through the environment
file.

Typically, the way this works is there is a ARGS environment variable
that gets sucked into the systemd unit file (or the sysv init file).
The previous version of this code left the file lying around if the
env_vars values were emptied. Proper practice should make sure that
file is garbage-collected if unmanaged.
For some reason, the bird exporter thinks that file should be created
even though it doesn't use init_style=none or
install_method=package. Sure, it does have default options, but it
seems that should normally not get triggered with default parameters.
@anarcat anarcat force-pushed the no-init-env-options branch from 3e555a4 to e04a233 Compare February 24, 2021 01:07
@anarcat
Copy link
Author

anarcat commented Feb 24, 2021

i'm at a loss as to why those tests fail. those env_file should not be created, normally, because those hosts don't have init_style=none... so any ideas here would be welcome.

This should make sure we don't create the env files when the env is
empty.
@anarcat
Copy link
Author

anarcat commented Feb 24, 2021

#531 was merged in here to facilitate debugging tests.

@anarcat anarcat merged commit e0023e5 into voxpupuli:master Mar 1, 2021
cegeka-jenkins pushed a commit to cegeka/puppet-prometheus that referenced this pull request Mar 11, 2024
pass options through env_vars if no control over init files
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.

2 participants