In cases where $KILL_ON_STOP_TIMEOUT is undefined, getting to line 99 will generate the following error:
```
/etc/init.d/logstash: line 99: [: : integer expression expected
```
I'm no shell scripting expert, but from some tinkering I landed upon changing
```
if [ "$KILL_ON_STOP_TIMEOUT" -eq 1 ] ;
```
to
```
if [[ $KILL_ON_STOP_TIMEOUT -eq 1 ]] ;
```
which appears to work for me.
Also, logstash often takes longer than 5 seconds to shut down for me, so adding a few more seconds to the countdown on line 93 might help.
Might fix https://github.com/elastic/logstash/issues/4457Fixes#4732
No need to export all the JAVA* related environment variables
for configtest. It needs a minimal set of variables to execute
bin/logstash --config-test. This was indirectly causing issues
when used with JMX options in LS_JAVA_OPTS. JMX needs a remote port defined
and configtest was trying to connect to the port twice which caused
restart (#4319) to fail
Fixes#4319Fixes#4759
It should come before the `-f`, otherwise Logstash might bind a port and
start running, rather than only perform a configtest, then exit.
fixes 4737
Fixes#4738
This should fix a test failure on CentOS 6 where 'emit' gives 'command
not found' which, as the last command run in stop(), causes stop() to
always return exit code 127.
Fixes#3614
updated the packaged to enable JAVA_OPTS to override the defaults
ammended JAVA_OPTS being exported
ammend warning wording
ammend the last commit
fix wording again
Fixes#2942
remove stale code
cleanup the bash conditions for when a variable is defined or not
make sure LS_JAVA_OPTS override JAVA_OPTS when need
ammend unused var
rollback to previous use case of appending vars to JAVA_OPTS in the case of having LS_JAVA_OPTS
Fixes#2942