

The NAME and PID_FILE are set as: NAME=elasticsearch In the script the PID_DIR variable is set as : PID_DIR=/var/run/elasticsearchīut there is no such directory exists and there is command to create it in the script too. The problem turned out to be the SysV script /etc/init.d/elasticsearch itself. JAVA_HOME=/home/mockie/softwares/jdk1.8.0_45Īnd it works! but what I want is to use sudo /etc/init.d/elasticsearch start without sudo su first. This is full code for etc/init.d/elasticsearch :Īnd this is my etc/environment: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" I also tried debug /etc/init.d/elasticsearch like this: echo "$JAVA_HOME/dodol"Īnd the result was empty and only return "/dodol". I got the result /home/mockie/softwares/jdk1.8.0_45 for the both which is correct path for my JAVA.


I tried debug the JAVA_HOME variable in terminal like this: This is the command I use to run elasticsearch: bashrc, etc/environment, etc/.profile all fail. I'm trying to set JAVA_HOME for elasticsearch but no luck till now.
