|
@@ -32,8 +32,6 @@ if [ -f /etc/rc.d/init.d/functions ]; then
|
|
|
fi
|
|
|
|
|
|
# Sets the default values for elasticsearch variables used in this script
|
|
|
-ES_USER="elasticsearch"
|
|
|
-ES_GROUP="elasticsearch"
|
|
|
ES_HOME="/usr/share/elasticsearch"
|
|
|
MAX_OPEN_FILES=65536
|
|
|
MAX_MAP_COUNT=262144
|
|
@@ -55,6 +53,12 @@ if [ ! -z "$CONF_FILE" ]; then
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
+# ES_USER and ES_GROUP settings were removed
|
|
|
+if [ ! -z "$ES_USER" ] || [ ! -z "$ES_GROUP" ]; then
|
|
|
+ echo "ES_USER and ES_GROUP settings are no longer supported. To run as a custom user/group use the archive distribution of Elasticsearch."
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
exec="$ES_HOME/bin/elasticsearch"
|
|
|
prog="elasticsearch"
|
|
|
pidfile="$PID_DIR/${prog}.pid"
|
|
@@ -67,11 +71,6 @@ export ES_STARTUP_SLEEP_TIME
|
|
|
|
|
|
lockfile=/var/lock/subsys/$prog
|
|
|
|
|
|
-# backwards compatibility for old config sysconfig files, pre 0.90.1
|
|
|
-if [ -n $USER ] && [ -z $ES_USER ] ; then
|
|
|
- ES_USER=$USER
|
|
|
-fi
|
|
|
-
|
|
|
if [ ! -x "$exec" ]; then
|
|
|
echo "The elasticsearch startup script does not exists or it is not executable, tried: $exec"
|
|
|
exit 1
|
|
@@ -106,16 +105,16 @@ start() {
|
|
|
|
|
|
# Ensure that the PID_DIR exists (it is cleaned at OS startup time)
|
|
|
if [ -n "$PID_DIR" ] && [ ! -e "$PID_DIR" ]; then
|
|
|
- mkdir -p "$PID_DIR" && chown "$ES_USER":"$ES_GROUP" "$PID_DIR"
|
|
|
+ mkdir -p "$PID_DIR" && chown elasticsearch:elasticsearch "$PID_DIR"
|
|
|
fi
|
|
|
if [ -n "$pidfile" ] && [ ! -e "$pidfile" ]; then
|
|
|
- touch "$pidfile" && chown "$ES_USER":"$ES_GROUP" "$pidfile"
|
|
|
+ touch "$pidfile" && chown elasticsearch:elasticsearch "$pidfile"
|
|
|
fi
|
|
|
|
|
|
cd $ES_HOME
|
|
|
echo -n $"Starting $prog: "
|
|
|
# if not running, start it up here, usually something like "daemon $exec"
|
|
|
- daemon --user $ES_USER --pidfile $pidfile $exec -p $pidfile -d -Edefault.path.logs=$LOG_DIR -Edefault.path.data=$DATA_DIR -Edefault.path.conf=$CONF_DIR
|
|
|
+ daemon --user elasticsearch --pidfile $pidfile $exec -p $pidfile -d -Edefault.path.logs=$LOG_DIR -Edefault.path.data=$DATA_DIR -Edefault.path.conf=$CONF_DIR
|
|
|
retval=$?
|
|
|
echo
|
|
|
[ $retval -eq 0 ] && touch $lockfile
|