Skip to content

Instantly share code, notes, and snippets.

@crofty
Created February 6, 2014 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save crofty/8841470 to your computer and use it in GitHub Desktop.
Save crofty/8841470 to your computer and use it in GitHub Desktop.
Upstart for elasticsearch
# ElasticSearch Service
description "ElasticSearch"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn limit 10 5
env ES_HOME=/usr/share/elasticsearch
env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/bin/java
env LOG_DIR=/var/log/elasticsearch
env DATA_DIR=/var/lib/elasticsearch
env WORK_DIR=/tmp/elasticsearch
env CONFIG_DIR=/etc/elasticsearch
env DEFAULT_CONFIG=/etc/elasticsearch/elasticsearch.yml
env DAEMON=/usr/share/elasticsearch/bin/elasticsearch
console output
script
if [ -f /etc/default/elasticsearch ]; then
. /etc/default/elasticsearch
fi
su -s /bin/dash -c "$DAEMON -f -Des.default.config=$DEFAULT_CONFIG -Des.path.conf=$CONFIG_DIR -Des.path.home=$ES_HOME -Des.path.logs=$LOG_DIR -Des.path.data=$DATA_DIR -Des.path.work=$WORK_DIR" elasticsearch
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment