aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/blackbox_exporter
diff options
context:
space:
mode:
authorRyan Steinmetz <zi@FreeBSD.org>2020-07-09 15:56:39 +0000
committerRyan Steinmetz <zi@FreeBSD.org>2020-07-09 15:56:39 +0000
commit700e62dd9d02b2072ed9fd929ecee22fe0ecffe2 (patch)
tree5be691085a26b5debac5cadba7a12ea4cc872b14 /net-mgmt/blackbox_exporter
parentaa3a33018599994fc100db177103eb5389305991 (diff)
downloadports-700e62dd9d02b2072ed9fd929ecee22fe0ecffe2.tar.gz
ports-700e62dd9d02b2072ed9fd929ecee22fe0ecffe2.zip
- Switch to a solution that supports log rotation
- Update pkg-message with details/examples - Fix missing name in daemon(1) process - Set daemon(1) log process name - Bump PORTREVISION PR: 245601 Submitted by: zi@ Approved by: bsam@ (maintainer timeout, 2+ months)
Notes
Notes: svn path=/head/; revision=541759
Diffstat (limited to 'net-mgmt/blackbox_exporter')
-rw-r--r--net-mgmt/blackbox_exporter/Makefile10
-rw-r--r--net-mgmt/blackbox_exporter/files/blackbox_exporter.in17
-rw-r--r--net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog3
-rw-r--r--net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog3
-rw-r--r--net-mgmt/blackbox_exporter/files/pkg-message.in4
-rw-r--r--net-mgmt/blackbox_exporter/pkg-plist5
6 files changed, 25 insertions, 17 deletions
diff --git a/net-mgmt/blackbox_exporter/Makefile b/net-mgmt/blackbox_exporter/Makefile
index 08dec27a9c99..a34e35217633 100644
--- a/net-mgmt/blackbox_exporter/Makefile
+++ b/net-mgmt/blackbox_exporter/Makefile
@@ -3,6 +3,7 @@
PORTNAME= blackbox_exporter
PORTVERSION= 0.17.0
+PORTREVISION= 1
DISTVERSIONPREFIX=v
CATEGORIES= net-mgmt
@@ -28,9 +29,6 @@ OPTIONS_DEFINE= EXAMPLES
SUB_FILES= pkg-message
SUB_LIST= GH_TAGNAME=${GH_TAGNAME}
-PLIST_FILES= bin/blackbox_exporter \
- ${EXAMPLESDIR}/blackbox.yml \
- ${EXAMPLESDIR}/example.yml
post-extract:
${RM} -r ${WRKSRC}/vendor/golang.org/x/net
@@ -39,5 +37,11 @@ post-extract:
post-install:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/*.yml ${STAGEDIR}${EXAMPLESDIR}
+ ${MKDIR} ${STAGEDIR}${DATADIR}/syslog.d \
+ ${STAGEDIR}${DATADIR}/newsyslog.conf.d
+ ${INSTALL_DATA} ${PATCHDIR}/blackbox_exporter.syslog \
+ ${STAGEDIR}${DATADIR}/syslog.d/blackbox_exporter.conf
+ ${INSTALL_DATA} ${PATCHDIR}/blackbox_exporter.newsyslog \
+ ${STAGEDIR}${DATADIR}/newsyslog.conf.d/blackbox_exporter.conf
.include <bsd.port.mk>
diff --git a/net-mgmt/blackbox_exporter/files/blackbox_exporter.in b/net-mgmt/blackbox_exporter/files/blackbox_exporter.in
index 6399317bbe25..97beba8b28ae 100644
--- a/net-mgmt/blackbox_exporter/files/blackbox_exporter.in
+++ b/net-mgmt/blackbox_exporter/files/blackbox_exporter.in
@@ -21,8 +21,6 @@
# Default is "localhost:9115".
# blackbox_exporter_config (string): Set configuration file of blackbox_exporter
# Default is "%%PREFIX%%/etc/blackbox_exporter.yml".
-# blackbox_exporter_log_file (string): Set log file of blackbox_exporter
-# Default is "/var/log/blackbox_exporter.log".
. /etc/rc.subr
@@ -37,15 +35,15 @@ load_rc_config $name
: ${blackbox_exporter_group:=prometheus}
: ${blackbox_exporter_listen_address=localhost:9115}
: ${blackbox_exporter_config="%%PREFIX%%/etc/blackbox_exporter.yml"}
-: ${blackbox_exporter_log_file=/var/log/blackbox_exporter.log}
pidfile=/var/run/blackbox_exporter.pid
command=/usr/sbin/daemon
procname="%%PREFIX%%/bin/blackbox_exporter"
-command_args="-p ${pidfile} /usr/bin/env ${procname} \
+command_args="-p ${pidfile} -t ${name} -T ${name} -S \
+ /usr/bin/env ${procname} \
--web.listen-address=${blackbox_exporter_listen_address} \
--config.file=${blackbox_exporter_config} \
- ${blackbox_exporter_args} >> ${blackbox_exporter_log_file} 2>&1"
+ ${blackbox_exporter_args} 2>&1"
start_precmd=blackbox_exporter_startprecmd
@@ -59,15 +57,6 @@ blackbox_exporter_startprecmd()
else
chown ${blackbox_exporter_user}:${blackbox_exporter_group} ${pidfile};
fi
- if [ ! -e ${blackbox_exporter_log_file} ]; then
- install \
- -o ${blackbox_exporter_user} \
- -g ${blackbox_exporter_group} \
- -m 640 \
- /dev/null ${blackbox_exporter_log_file};
- else
- chown ${blackbox_exporter_user}:${blackbox_exporter_group} ${blackbox_exporter_log_file};
- fi
}
run_rc_command "$1"
diff --git a/net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog b/net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog
new file mode 100644
index 000000000000..64c7355bf669
--- /dev/null
+++ b/net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+/var/log/blackbox_exporter.log 644 7 1000 * J
diff --git a/net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog b/net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog
new file mode 100644
index 000000000000..d676efeff2a6
--- /dev/null
+++ b/net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog
@@ -0,0 +1,3 @@
+# $FreeBSD$
+!blackbox_exporter
+*.* /var/log/blackbox_exporter.log
diff --git a/net-mgmt/blackbox_exporter/files/pkg-message.in b/net-mgmt/blackbox_exporter/files/pkg-message.in
index 05c007f8758e..ae772601a782 100644
--- a/net-mgmt/blackbox_exporter/files/pkg-message.in
+++ b/net-mgmt/blackbox_exporter/files/pkg-message.in
@@ -16,6 +16,10 @@ blackbox_exporter_listen_address rcvar.
To use the 'ping' module, blackbox_exporter needs to run with
root privileges. To run blackbox_exporter with root privileges,
run "sysrc blackbox_exporter_user=root".
+
+By default, blackbox exporter will log via syslog. Examples for
+controlling which log file and setting up log rotation may be found in:
+%%DATADIR%%
EOM
}
]
diff --git a/net-mgmt/blackbox_exporter/pkg-plist b/net-mgmt/blackbox_exporter/pkg-plist
new file mode 100644
index 000000000000..be9d5cfc7766
--- /dev/null
+++ b/net-mgmt/blackbox_exporter/pkg-plist
@@ -0,0 +1,5 @@
+bin/blackbox_exporter
+%%DATADIR%%/newsyslog.conf.d/blackbox_exporter.conf
+%%DATADIR%%/syslog.d/blackbox_exporter.conf
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/blackbox.yml
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example.yml