FreeBSD Bugzilla – Attachment 213373 Details for
Bug 245601
[patch] Fix missing log rotation, daemon(1) process names in net-mgmt/blackbox_exporter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Log rotation fix, daemon(1) naming fix
blackbox_exporter.diff.txt (text/plain), 4.60 KB, created by
Ryan Steinmetz
on 2020-04-13 15:02:23 UTC
(
hide
)
Description:
Log rotation fix, daemon(1) naming fix
Filename:
MIME Type:
Creator:
Ryan Steinmetz
Created:
2020-04-13 15:02:23 UTC
Size:
4.60 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 531015) >+++ Makefile (working copy) >@@ -4,7 +4,7 @@ > PORTNAME= blackbox_exporter > PORTVERSION= 0.16.0 > DISTVERSIONPREFIX=v >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= net-mgmt > > MAINTAINER= bsam@FreeBSD.org >@@ -29,9 +29,6 @@ > > 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 >@@ -40,5 +37,11 @@ > 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> >Index: files/blackbox_exporter.in >=================================================================== >--- files/blackbox_exporter.in (revision 531015) >+++ files/blackbox_exporter.in (working copy) >@@ -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 @@ > : ${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 @@ > 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" >Index: files/blackbox_exporter.newsyslog >=================================================================== >--- files/blackbox_exporter.newsyslog (nonexistent) >+++ files/blackbox_exporter.newsyslog (working copy) >@@ -0,0 +1,3 @@ >+# $FreeBSD$ >+ >+/var/log/blackbox_exporter.log 644 7 1000 * J >Index: files/blackbox_exporter.syslog >=================================================================== >--- files/blackbox_exporter.syslog (nonexistent) >+++ files/blackbox_exporter.syslog (working copy) >@@ -0,0 +1,3 @@ >+# $FreeBSD$ >+!blackbox_exporter >+*.* /var/log/blackbox_exporter.log >Index: files/pkg-message.in >=================================================================== >--- files/pkg-message.in (revision 531015) >+++ files/pkg-message.in (working copy) >@@ -16,6 +16,10 @@ > 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 > } > ] >Index: pkg-plist >=================================================================== >--- pkg-plist (nonexistent) >+++ pkg-plist (working copy) >@@ -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 > >Property changes on: pkg-plist >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 245601
: 213373