diff options
author | feld <feld@FreeBSD.org> | 2018-04-07 22:01:22 +0800 |
---|---|---|
committer | feld <feld@FreeBSD.org> | 2018-04-07 22:01:22 +0800 |
commit | 156c7df36113715bf5f84d1a91b9bf92af3b9ea4 (patch) | |
tree | c22bc57a4ca9964c58e0eaf5a04810b599a8757b /sysutils/logstash6 | |
parent | c8e22382ffab932a2af716a3c7837766339d236e (diff) | |
download | freebsd-ports-gnome-156c7df36113715bf5f84d1a91b9bf92af3b9ea4.tar.gz freebsd-ports-gnome-156c7df36113715bf5f84d1a91b9bf92af3b9ea4.tar.zst freebsd-ports-gnome-156c7df36113715bf5f84d1a91b9bf92af3b9ea4.zip |
sysutils/logstash6: Run as non-root by default
- Added logstash user/group
MFH: 2018Q2
Diffstat (limited to 'sysutils/logstash6')
-rw-r--r-- | sysutils/logstash6/Makefile | 9 | ||||
-rw-r--r-- | sysutils/logstash6/files/logstash.in | 10 |
2 files changed, 12 insertions, 7 deletions
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() |