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

ES RedHat/Centos Init script not exporting JAVA_HOME #5433

Closed
alex-leonhardt opened this issue Mar 14, 2014 · 8 comments
Closed

ES RedHat/Centos Init script not exporting JAVA_HOME #5433

alex-leonhardt opened this issue Mar 14, 2014 · 8 comments
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team

Comments

@alex-leonhardt
Copy link

Hi,

export JAVA_HOME is missing from the init script in ES RPM 1.0.1-1 noarch.

when trying to make ES use a specific version of Java it fails until one "fixes" the init script to include :

[...]

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

export ES_HEAP_SIZE
export ES_HEAP_NEWSIZE
export ES_DIRECT_SIZE
export ES_JAVA_OPTS
export JAVA_HOME

lockfile=/var/lock/subsys/$prog

[...]

Alex

@alappe
Copy link

alappe commented Sep 25, 2014

This really would be an easy fix to get a working default setup on centos… 👍

@clintongormley clintongormley added the :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts label Sep 29, 2014
@electrical
Copy link
Contributor

For what specific use case would you need to export it?
If you would set JAVA_HOME in the /etc/sysconfig/$prog file it should be fine?
Or is it being used somewhere else as well?

@alappe
Copy link

alappe commented Sep 30, 2014

Searching for a solution why my installation didn't work, I came across @alex-leonhardt fix – and it worked. After posting the comment, I came to realize I didn't really understand why this makes any difference, since the variable should already be exported… but nevertheless it works here.

Maybe @alex-leonhardt has more insight… if not, I'd need to build up a clean system to test with/without, which I cannot find the time this week…

@alex-leonhardt
Copy link
Author

Wow, this is so long ago I can't remember exactly; there was a good reason for having to export it.

@clintongormley
Copy link

Could it be that, when the script drops privileges, that it also resets the environment?

@clintongormley
Copy link

Would making this change break anything? If not, I'd suggest we do it.

@electrical
Copy link
Contributor

I don't expect it to break anything if we would export it.

@clintongormley
Copy link

@electrical OK thanks. Does that mean you're going to do it?

spinscale pushed a commit that referenced this issue Nov 1, 2014
spinscale pushed a commit that referenced this issue Nov 1, 2014
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
@electrical electrical removed their assignment Feb 14, 2016
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team
Projects
None yet
Development

No branches or pull requests

5 participants