From owner-svn-ports-all@freebsd.org Thu Jul 9 15:56:41 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 601A536EE93; Thu, 9 Jul 2020 15:56:41 +0000 (UTC) (envelope-from zi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2glY20WFz4D79; Thu, 9 Jul 2020 15:56:41 +0000 (UTC) (envelope-from zi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2971B1373F; Thu, 9 Jul 2020 15:56:41 +0000 (UTC) (envelope-from zi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 069Fufmi055829; Thu, 9 Jul 2020 15:56:41 GMT (envelope-from zi@FreeBSD.org) Received: (from zi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 069FueVP055824; Thu, 9 Jul 2020 15:56:40 GMT (envelope-from zi@FreeBSD.org) Message-Id: <202007091556.069FueVP055824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zi set sender to zi@FreeBSD.org using -f From: Ryan Steinmetz Date: Thu, 9 Jul 2020 15:56:40 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r541759 - in head/net-mgmt/blackbox_exporter: . files X-SVN-Group: ports-head X-SVN-Commit-Author: zi X-SVN-Commit-Paths: in head/net-mgmt/blackbox_exporter: . files X-SVN-Commit-Revision: 541759 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 15:56:41 -0000 Author: zi Date: Thu Jul 9 15:56:39 2020 New Revision: 541759 URL: https://svnweb.freebsd.org/changeset/ports/541759 Log: - 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) Added: head/net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog (contents, props changed) head/net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog (contents, props changed) head/net-mgmt/blackbox_exporter/pkg-plist (contents, props changed) Modified: head/net-mgmt/blackbox_exporter/Makefile head/net-mgmt/blackbox_exporter/files/blackbox_exporter.in (contents, props changed) head/net-mgmt/blackbox_exporter/files/pkg-message.in Modified: head/net-mgmt/blackbox_exporter/Makefile ============================================================================== --- head/net-mgmt/blackbox_exporter/Makefile Thu Jul 9 15:53:42 2020 (r541758) +++ head/net-mgmt/blackbox_exporter/Makefile Thu Jul 9 15:56:39 2020 (r541759) @@ -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 Modified: head/net-mgmt/blackbox_exporter/files/blackbox_exporter.in ============================================================================== --- head/net-mgmt/blackbox_exporter/files/blackbox_exporter.in Thu Jul 9 15:53:42 2020 (r541758) +++ head/net-mgmt/blackbox_exporter/files/blackbox_exporter.in Thu Jul 9 15:56:39 2020 (r541759) @@ -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 @@ -58,15 +56,6 @@ blackbox_exporter_startprecmd() /dev/null ${pidfile}; 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 } Added: head/net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/blackbox_exporter/files/blackbox_exporter.newsyslog Thu Jul 9 15:56:39 2020 (r541759) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +/var/log/blackbox_exporter.log 644 7 1000 * J Added: head/net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/blackbox_exporter/files/blackbox_exporter.syslog Thu Jul 9 15:56:39 2020 (r541759) @@ -0,0 +1,3 @@ +# $FreeBSD$ +!blackbox_exporter +*.* /var/log/blackbox_exporter.log Modified: head/net-mgmt/blackbox_exporter/files/pkg-message.in ============================================================================== --- head/net-mgmt/blackbox_exporter/files/pkg-message.in Thu Jul 9 15:53:42 2020 (r541758) +++ head/net-mgmt/blackbox_exporter/files/pkg-message.in Thu Jul 9 15:56:39 2020 (r541759) @@ -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 } ] Added: head/net-mgmt/blackbox_exporter/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/blackbox_exporter/pkg-plist Thu Jul 9 15:56:39 2020 (r541759) @@ -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