elasticsearch/cookbook-elasticsearch — pull request #114 by dyangrev (2013-07-17 06:05:01+00:00)
Title: Fix the stop function in init script

In some case the process of elasticsearch changes to
1017 23661 17.0 0.0 0 0 ? Zl Jun25 5181:59 [java]
after executing the line so <%= node [: elasticsearch][:user] %> -m -c "kill $(cat $PIDFILE)".

The process is still there for a while but ps aux | grep 'java' | grep -e "es.pidfile" in the restart() function thinks the process has already been killed and tries to start, and start fails because the memory is not enough to create the jvm heap, and chef log shows "service [elasticsearch] restarted].

Need to make sure the pid does get killed in the stop().