From 156c7df36113715bf5f84d1a91b9bf92af3b9ea4 Mon Sep 17 00:00:00 2001 From: feld Date: Sat, 7 Apr 2018 14:01:22 +0000 Subject: sysutils/logstash6: Run as non-root by default - Added logstash user/group MFH: 2018Q2 --- sysutils/logstash6/Makefile | 9 ++++++--- sysutils/logstash6/files/logstash.in | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'sysutils/logstash6') diff --git a/sysutils/logstash6/Makefile b/sysutils/logstash6/Makefile index ae299edfa12f..9f7f347c2876 100644 --- a/sysutils/logstash6/Makefile +++ b/sysutils/logstash6/Makefile @@ -3,7 +3,7 @@ PORTNAME= logstash PORTVERSION= 6.2.2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils java MASTER_SITES= http://artifacts.elastic.co/downloads/logstash/ PKGNAMESUFFIX= 6 @@ -25,6 +25,9 @@ JAVA_VERSION= 1.8+ JAVA_RUN= yes NO_BUILD= yes +USERS= logstash +GROUPS= logstash + LOGSTASH_DIR= ${PREFIX}/${PORTNAME} USE_RC_SUBR= logstash @@ -35,7 +38,7 @@ SUB_LIST= JAVA_HOME=${JAVA_HOME} \ LOGSTASH_HOME=${LOGSTASH_HOME} LOGSTASH_CONF_FILES= jvm.options log4j2.properties logstash.yml pipelines.yml -LOGSTASH_JRUBY_SUBDIR= vendor/jruby/bin +LOGSTASH_JRUBY_SUBDIR= vendor/jruby/bin LOGSTASH_JRUBY_BIN_FILES= ast irb jirb jruby jruby.sh rdoc testrb gem \ jgem jirb_swing jruby.bash jrubyc rake ri @@ -65,7 +68,7 @@ post-install: .endfor ${FIND} -s ${STAGEDIR}${PREFIX}/logstash -not -type d | ${SORT} | \ ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST} - ${ECHO} "@dir logstash/data" >> ${TMPPLIST} + ${ECHO} "@dir(logstash,logstash,) logstash/data" >> ${TMPPLIST} ${ECHO} "@dir logstash/vendor/bundle/jruby/2.3.0/build_info" >> ${TMPPLIST} ${ECHO} "@dir logstash/vendor/bundle/jruby/2.3.0/cache" >> ${TMPPLIST} ${ECHO} "@dir logstash/vendor/bundle/jruby/2.3.0/doc" >> ${TMPPLIST} diff --git a/sysutils/logstash6/files/logstash.in b/sysutils/logstash6/files/logstash.in index 2426ca066b87..4f33651a3f6c 100644 --- a/sysutils/logstash6/files/logstash.in +++ b/sysutils/logstash6/files/logstash.in @@ -55,6 +55,8 @@ load_rc_config ${name} logdir="/var/log" : ${logstash_enable="NO"} +: ${logstash_user="logstash"} +: ${logstash_group="logstash"} : ${logstash_home="%%LOGSTASH_HOME%%"} : ${logstash_config="%%ETCDIR%%"} : ${logstash_log="YES"} @@ -96,10 +98,10 @@ PATH=/usr/local/bin:$PATH logstash_precmd() { - /usr/bin/install -d -o root -g wheel -m 755 ${pidfile%/*} - /usr/bin/install -d -o root -g wheel -m 755 ${logstash_log_dir} - /usr/bin/install -d -o root -g wheel -m 755 /var/db/logstash - /usr/bin/install -d -o root -g wheel -m 755 /var/run/logstash + /usr/bin/install -d -o ${logstash_user} -g ${logstash_group} -m 755 ${pidfile%/*} + /usr/bin/install -d -o ${logstash_user} -g ${logstash_group} -m 755 ${logstash_log_dir} + /usr/bin/install -d -o ${logstash_user} -g ${logstash_group} -m 755 /var/db/logstash + /usr/bin/install -d -o ${logstash_user} -g ${logstash_group} -m 755 /var/run/logstash } configtest() -- cgit