The right way to specify environment?

I'm trying to figure out how I am supposed to setup a consistent environment for logstash to startup correctly.

# /usr/share/logstash/bin/system-install 
Successfully created system startup script for Logstash

Looks good, but when I run :

Mar 02 13:29:04 adva logstash[15141]: Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.

If I fix /etc/default/logstash to include JAVA_HOME then the service starts correctly

Now, the problem is each time I run system-install it blows up /etc/default/logstash which is now empty, and logstash doesn't start anymore.

My startup.options contains these non empty/comment lines :

JAVACMD=/usr/local/nabox/java/bin/java
LS_HOME=/usr/share/logstash
LS_SETTINGS_DIR=/opt/logstash/etc
LS_OPTS="--path.settings ${LS_SETTINGS_DIR}"
LS_JAVA_OPTS=""
LS_PIDFILE=/var/run/logstash.pid
LS_USER=logstash
LS_GROUP=logstash
LS_GC_LOG_FILE=/var/log/logstash/gc.log
LS_OPEN_FILES=16384
LS_NICE=19
SERVICE_NAME="logstash"
SERVICE_DESCRIPTION="logstash"

It has every information needed to create a workable startup script but is missing something obviously. What am I doing wrong? Is there something I can put here that would end up declaring JAVA_HOME corectly in /etc/default/logstash

You are probably hitting https://github.com/elastic/logstash/issues/6482, which has been fixed and will be released in 5.3.0.

Yes, looks like a match!

I'll test it again on 5.3 then, any ETA?

Thank you

Should be shortly after the 15th of March.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.