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
Rework sysconfig file/startup environment #6328
Conversation
TODO: Windows, as always Testing:
|
getenv() also is available on Windows, needs proper tests though. |
Users kept asking about it, still it is just an "information" that this isn't needed yet.
The sysconfig file now only contains the defaults as comments, changes made there are given to the init.d script, prepare-dirs, safe-reload and Icinga 2 itself. If nothing is set in the sysconfig file (as is the default as all lines are commented out) the defaults are used. fixes #6255
Logging breaks autocomplete, with this patch we should only log when something is going terribly wrong and execution can't be guaranteed or is destined to fail. This commit depends on the previous one which is why it's not in its own pull request. fixes #6256
While windows can use getenv, we never set the environment and the user we store at a different place. So this is a different issue. |
True that, still we should keep it in mind when it comes to changes related to environments (where getenv() comes in handy). |
It seems that this PR cherry-picked a commit of mine and is not fast forward. |
I couldn't get the expected result while testing this on Ubuntu 18.04. Tested with: Both logs were still written to icinga2.log and error.log I've also tried removing the file to validate that it is in the correct location: |
that's from a git source, how does your sysconfig file actually look like on the system you're testing on? The wrong location for Debian-ized sysconfig files needs to be dealt with in a separate patch, hiding this warning. Maybe you're using the wrong branch to test, which commit are you on? |
Whoops… didn't see that CMAKE variable there :D And you're right I used https://build.icinga.com/job/icinga2-dev/job/deb-ubuntu-bionic-1binary/arch=x86_64/1/, because @Crunsher said that that build is based on branch sysconfig-env but is actually based on master. Sorry for that, will test it again. |
The dev package was built from the sysconfig-env. If the result is of the wrong branch, our dev pipeline is broken |
@Crunsher you're right, it build from sysconfig-env and did what it should.
But it still doesn't affect Icinga. |
Keep in mind that Same applies to the other settings above. Looking at the patch I can only see that USER/GROUP and RTSTACK limits are properly read and used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my notes above, all environment variables should have an effect on Icinga 2, even without Systemd/init.d.
ReviewAs discussed offline, this issue is solely to fix USER, GROUP and RLIMIT settings which have been introduced with 2.8.2. No other focus with environment variables here. Set environment variable
RSTACKRequires Linux, doesn't work on macOS. Updates soon from inside Vagrant. |
Manual Stacksize on Linux
Systemd
|
Initscripts pass the environment variables as expected, there's not much difference here involved. |
The sysconifg file now only contains the defaults as comments, changes
made there are given to the init.d script, prepare-dirs, safe-reload and
Icinga 2 itself. If nothing is set in the sysconfig file (as is the
default as all lines are commented out) the defaults are used.
fixes #6255