<% @path = "/etc/init/elasticsearch.conf" @backup = false %> description "elasticsearch server" start on runlevel [2345] stop on runlevel [016] script cd <%= rubber_env.elasticsearch_dir %> ulimit -n 65536 exec ./bin/elasticsearch -f end script post-start script status elasticsearch | head -n1 | awk '{print $NF}' > <%= rubber_env.elasticsearch_pid_file %> while ! curl -s 'http://localhost:<%= rubber_env.elasticsearch_http_port %>/_status' > /dev/null 2>&1; do sleep 1 ; done end script post-stop script rm -f <%= rubber_env.elasticsearch_pid_file %> end script