aboutsummaryrefslogtreecommitdiffstats
path: root/community/elasticsearch/elasticsearch.initd
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-01-23 14:56:52 +0100
committerJakub Jirutka <jakub@jirutka.cz>2019-01-23 16:15:07 +0100
commit7c4e67edf985e3386d882973bd78662a9296a750 (patch)
tree3352bdd73399679a1a098d26605b8892f90b8a72 /community/elasticsearch/elasticsearch.initd
parent46bd6e6b18d0e5b919c717db21bce3243a8306b3 (diff)
downloadaports-7c4e67edf985e3386d882973bd78662a9296a750.tar.bz2
aports-7c4e67edf985e3386d882973bd78662a9296a750.tar.xz
community/elasticsearch: fix and improve init script
* SVCNAME is deprecated for a very long time, RC_SVCNAME should be used * nice 0 is the default value, not needed to define * error.log was previously owned by root instead of the ES user, so we need to fix it
Diffstat (limited to 'community/elasticsearch/elasticsearch.initd')
-rw-r--r--community/elasticsearch/elasticsearch.initd13
1 files changed, 7 insertions, 6 deletions
diff --git a/community/elasticsearch/elasticsearch.initd b/community/elasticsearch/elasticsearch.initd
index f992b0b8a6..eefaceb7a7 100644
--- a/community/elasticsearch/elasticsearch.initd
+++ b/community/elasticsearch/elasticsearch.initd
@@ -3,7 +3,7 @@ supervisor=supervise-daemon
description="A Distributed RESTful Search Engine."
-instance_name="${SVCNAME#elasticsearch.}"
+instance_name="${RC_SVCNAME#elasticsearch.}"
instance_name="${instance_name/elasticsearch/_default}"
name="Elasticsearch"
@@ -20,6 +20,7 @@ name="Elasticsearch"
: ${default_script_dir:="$conf_dir/scripts"}
: ${default_work_dir:="/var/tmp/elasticsearch/$instance_name"}
: ${create_logs_dir:="yes"}
+: ${error_log:="$default_logs_dir/error.log"}
elastic_opts="
-Epath.data=$default_data_dir
@@ -41,11 +42,11 @@ export ES_JAVA_OPTS="$java_opts"
export ES_JVM_OPTIONS="$conf_dir/jvm.options"
export ES_PATH_CONF="$conf_dir"
-nice="0"
-pidfile="/run/$SVCNAME.sd.pid"
-supervise_daemon_args="-u $user -g $group -p $pidfile -N $nice"
-command=/usr/share/java/elasticsearch/bin/elasticsearch
-command_args="$elastic_opts 1>/dev/null 2>>$default_logs_dir/error.log"
+command="/usr/share/java/elasticsearch/bin/elasticsearch"
+command_args="$elastic_opts"
+command_user="$user:$group"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME.sd.pid"
depends() {
use net