-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
JAVACMD in startup.options not taken into account with upstart #6482
Comments
Was any attempt made to use the Can we see the contents of the upstart script (presumably |
update-alternatives seems to only work for system packages.
The generated file looks like this:
I think the issue might be that |
startup.options is only for the bin/system-install tool. |
@jordansissel are you saying that it only defines which java will be used to run |
Yes indeed :) pleaserun generate a service that will try to load things from /etc/sysconfig/logstash and /etc/default/logstash before it runs logstash. You can see that above in your upstart job:
|
This perhaps is not well documented, and we could do better, but I don't think we set the expectation that a JAVACMD environment variable would persist from |
It should be put in a separate block in that file, with notes/documentation that "these entries need to go into /etc/sysconfig/logstash or /etc/default/logstash" or something like that. |
I will say, I agree with the report that this behavior is probably a bit confusing. We could make this behavior work to pass environment variables through, perhaps generating an /etc/sysconfig/logstash or /etc/default/logstash based on the environment at the time system-install is run. Thoughts? |
That sounds interesting, actually. This could be done by grabbing some/all vars in startup.options and putting them in /etc/sysconfig/logstash or /etc/default/logstash. |
Thanks for clarifying @jordansissel @untergeek . We should better document where this is done for Logstash itself. Maybe add some comments in the But generating it from |
Conveniently, a recent feature landed in pleaserun to nearly do this: Example:
So maybe we can update |
This alaready exists though --- in
|
Oh I see, It makes sense now, but I didn't read it like that before. |
@jakommo I"m OK with adding it, but I don't believe anyone will actually read it. ;) |
Awesome, thanks @jordansissel . Should I close this or do you want to keep it open to discuss merging the startup.options into the init scripts? |
Leave this open until I add the |
Even when putting environment variables such as |
@mrbanzai content in /etc/sysconfig/logstash is a shell script, and variables aren't We're looking at ways to automatically export variables in these files but need to do testing to see how this might negatively impact users. |
Given that we're in a blended environment (EL6 and EL7), is the suggestion that we template out Thanks for the swift response, @jordansissel |
@mrbanzai I think @jakommo (or someone else? I forget) suggested that we should change our upstart/sysv to use |
I filed jordansissel/pleaserun#121 to track the pleaserun change for this. |
👍 @jordansissel I've moved to templating |
@untergeek regarding the original report here, which I would generalize as a kind of forwarding of environment variables from the system-install process into the sysv/upstart/systemd service. I think we can achieve this with modifications to Rough proposal:
Thoughts, @untergeek? |
Resolved Next: I'm working on environment-copying now. |
pleaserun v0.0.28 published. @untergeek I think the next step is to pass |
@jordansissel Yep! I just needed to know that would work in So, if I understand you correctly, I'll need the I'll try to get this coded and tested on some boxes by tomorrow's code freeze. |
Yep, |
This will now put ENV variables from the `startup.options` file into `/etc/default/logstash` or `/etc/sysconfig/logstash` (or whatever service name you chose), and use the updated pleaserun to ensure these are honored at start time for whichever init system you use (systemd, upstart, SysV). fixes elastic#6482
This will now put ENV variables from the `startup.options` file into `/etc/default/logstash` or `/etc/sysconfig/logstash` (or whatever service name you chose), and use the updated pleaserun to ensure these are honored at start time for whichever init system you use (systemd, upstart, SysV). fixes #6482
This will now put ENV variables from the `startup.options` file into `/etc/default/logstash` or `/etc/sysconfig/logstash` (or whatever service name you chose), and use the updated pleaserun to ensure these are honored at start time for whichever init system you use (systemd, upstart, SysV). fixes #6482
哦 |
export PATH="/tmp/jre1.8.0_111/bin:$PATH"
on the root shellJAVACMD=/tmp/jre1.8.0_111/bin/java
in/etc/logstash/startup.options
/usr/share/logstash/bin/system-install
(returns success)/usr/bin/java
/etc/default/logstash
, solved the issue.Not sure if related to #6199
The text was updated successfully, but these errors were encountered: