elasticsearch/elasticsearch — pull request #6909 by sbraz (2014-07-17 15:37:01+00:00)
Title: Prevent init script from returning when the service isn't actually started

Hello,
Since the init script uses start-stop-daemon's `-b` option, it might return from _start_ before the service is actually started. If the init script's _status_ action is called immediately after that, It will return `elasticsearch is not running` and exit with a non-zero code.
This causes systems like Heartbeat to incorrectly start multiple instances of Elasticsearch at once.
This pull request aims at fixing this issue by waiting until the Elasticsearch process is started.
There might be a nicer way to achieve this but this is what came to mind.