Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DeepInThought/261d1aa1230a26fd04ad9afef3fd8703 to your computer and use it in GitHub Desktop.
Save DeepInThought/261d1aa1230a26fd04ad9afef3fd8703 to your computer and use it in GitHub Desktop.
Elasticsearch Permission Fix
#!/bin/sh
# fix permissions (wrong if docker mounted volume)
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
# now switch to elasticsearch user and run in foreground
echo Starting: /usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@
su elasticsearch -s /bin/sh -c "/usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment