From 6d52df00f4d54eb87f17a0e8b3eace7f558b1394 Mon Sep 17 00:00:00 2001 From: Jason Unovitch Date: Wed, 5 Aug 2015 22:18:29 +0000 Subject: textproc/elasticsearch: update 1.6.0 -> 1.7.0 - Add NO_ARCH - Apply minor cleanup to rc scripts PR: 201834 Security: CVE-2015-5377 Security: fb3668df-32d7-11e5-a4a5-002590263bf5 Security: CVE-2015-5531 Security: ae8c09cb-32da-11e5-a4a5-002590263bf5 Approved by: ports-secteam (feld), feld (mentor) MFH: 2015Q3 --- textproc/elasticsearch/files/elasticsearch.in | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'textproc/elasticsearch/files/elasticsearch.in') diff --git a/textproc/elasticsearch/files/elasticsearch.in b/textproc/elasticsearch/files/elasticsearch.in index f6e53ff60f52..8c646f3b1a6f 100644 --- a/textproc/elasticsearch/files/elasticsearch.in +++ b/textproc/elasticsearch/files/elasticsearch.in @@ -27,7 +27,8 @@ name=elasticsearch rcvar=elasticsearch_enable -load_rc_config $name + +load_rc_config ${name} : ${elasticsearch_enable:="NO"} : ${elasticsearch_user:=%%SEARCHUSER%%} @@ -47,7 +48,6 @@ pidfile="/var/run/${name}.pid" ES_LIB="%%PREFIX%%/lib/elasticsearch" ES_CLASSPATH=$ES_LIB/elasticsearch-%%PORTVERSION%%.jar:$ES_LIB/*:$ES_LIB/sigar/* - java_options=" -server \ -Xms${elasticsearch_min_mem} \ -Xmx${elasticsearch_max_mem} \ @@ -71,7 +71,8 @@ stop_cmd="elasticsearch_stop" command="/usr/sbin/daemon" command_args="-f %%LOCALBASE%%/bin/java -Des.pidfile=${pidfile} ${elasticsearch_props} ${java_options} org.elasticsearch.bootstrap.Elasticsearch" -elasticsearch_precmd() { +elasticsearch_precmd() +{ touch ${pidfile} chown ${elasticsearch_user}:${elasticsearch_group} ${pidfile} /usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 750 ${elasticsearch_tmp} @@ -79,12 +80,14 @@ elasticsearch_precmd() { /usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 750 /var/log/elasticsearch } -elasticsearch_console () { +elasticsearch_console() +{ %%LOCALBASE%%/bin/java -Des.foreground=yes ${elasticsearch_props} ${java_options} org.elasticsearch.bootstrap.Elasticsearch } -elasticsearch_stop() { +elasticsearch_stop() +{ rc_pid=$(elasticsearch_check_pidfile $pidfile) if [ -z "$rc_pid" ]; then @@ -97,7 +100,8 @@ elasticsearch_stop() { kill ${rc_pid} 2> /dev/null } -elasticsearch_status() { +elasticsearch_status() +{ rc_pid=$(elasticsearch_check_pidfile $pidfile) if [ -z "$rc_pid" ]; then @@ -108,7 +112,8 @@ elasticsearch_status() { echo "${name} is running as pid ${rc_pid}." } -elasticsearch_check_pidfile() { +elasticsearch_check_pidfile() +{ _pidfile=$1 if [ -z "$_pidfile" ]; then err 3 'USAGE: elasticsearch_check_pidfile pidfile' @@ -126,5 +131,5 @@ elasticsearch_check_pidfile() { echo -n $_pid fi } -load_rc_config ${name} + run_rc_command "$1" -- cgit v1.2.3