aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorLi-Wen Hsu <lwhsu@FreeBSD.org>2018-04-05 10:20:41 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2018-04-05 10:20:41 +0000
commit4da77caf719de57bad591fa1abcd6a6bb89de58e (patch)
tree0d2f2d4438db499e5bbe919d1f1bed6b0e7603a7 /net-mgmt
parent5f837182e8871b81262993fcce261528de87d6cf (diff)
downloadports-4da77caf719de57bad591fa1abcd6a6bb89de58e.tar.gz
ports-4da77caf719de57bad591fa1abcd6a6bb89de58e.zip
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/grok_exporter/Makefile3
-rw-r--r--net-mgmt/grok_exporter/files/grok_exporter.in12
2 files changed, 10 insertions, 5 deletions
diff --git a/net-mgmt/grok_exporter/Makefile b/net-mgmt/grok_exporter/Makefile
index e19771898c2d..b88f3eaf3e8e 100644
--- a/net-mgmt/grok_exporter/Makefile
+++ b/net-mgmt/grok_exporter/Makefile
@@ -3,6 +3,7 @@
PORTNAME= grok_exporter
PORTVERSION= 0.2.3
DISTVERSIONPREFIX=v
+PORTREVISION= 1
CATEGORIES= net-mgmt
MAINTAINER= gasol.wu@gmail.com
@@ -20,6 +21,8 @@ USE_GITHUB= yes
GH_ACCOUNT= fstab logstash-plugins:plugins
GH_PROJECT= logstash-patterns-core:plugins
GH_TAGNAME= 6d25c13:plugins
+USERS= prometheus
+GROUPS= prometheus
GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}
USE_RC_SUBR= grok_exporter
diff --git a/net-mgmt/grok_exporter/files/grok_exporter.in b/net-mgmt/grok_exporter/files/grok_exporter.in
index d491565f814a..0c23c78af9af 100644
--- a/net-mgmt/grok_exporter/files/grok_exporter.in
+++ b/net-mgmt/grok_exporter/files/grok_exporter.in
@@ -13,9 +13,9 @@
# grok_exporter_config (string): Set path to config file
# Default is "%%ETCDIR%%/config.yml".
# grok_exporter_user (string): Set user that grok_exporter will run under
-# Default is "nobody".
+# Default is "prometheus".
# grok_exporter_group (string): Set group that grok_exporter will run under
-# Default is "nobody".
+# Default is "prometheus".
. /etc/rc.subr
@@ -27,8 +27,8 @@ load_rc_config $name
: ${grok_exporter_enable:=NO}
: ${grok_exporter_config:=%%ETCDIR%%/config.yml}
-: ${grok_exporter_user:=nobody}
-: ${grok_exporter_group:=nobody}
+: ${grok_exporter_user:=prometheus}
+: ${grok_exporter_group:=prometheus}
pidfile=/var/run/grok_exporter.pid
command=/usr/sbin/daemon
@@ -39,7 +39,9 @@ start_precmd=grok_exporter_startprecmd
grok_exporter_startprecmd()
{
- if [ ! -e ${pidfile} ]; then
+ if [ -e ${pidfile} ]; then
+ chown ${grok_exporter_user}:${grok_exporter_group} ${pidfile};
+ else
install -o ${grok_exporter_user} -g ${grok_exporter_group} /dev/null ${pidfile};
fi
}