Date: Thu, 7 Jun 2018 13:09:40 +0000 (UTC) From: Steve Wills <swills@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r471915 - in head/net-mgmt/grok_exporter: . files Message-ID: <201806071309.w57D9e3W021125@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: swills Date: Thu Jun 7 13:09:40 2018 New Revision: 471915 URL: https://svnweb.freebsd.org/changeset/ports/471915 Log: net-mgmt/grok_exporter: Fix rc startup script when booting PR: 228759 Submitted by: Gasol Wu <gasol.wu@gmail.com> (maintainer) Modified: head/net-mgmt/grok_exporter/Makefile (contents, props changed) head/net-mgmt/grok_exporter/files/grok_exporter.in Modified: head/net-mgmt/grok_exporter/Makefile ============================================================================== --- head/net-mgmt/grok_exporter/Makefile Thu Jun 7 13:00:19 2018 (r471914) +++ head/net-mgmt/grok_exporter/Makefile Thu Jun 7 13:09:40 2018 (r471915) @@ -3,7 +3,7 @@ PORTNAME= grok_exporter PORTVERSION= 0.2.3 DISTVERSIONPREFIX=v -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt MAINTAINER= gasol.wu@gmail.com Modified: head/net-mgmt/grok_exporter/files/grok_exporter.in ============================================================================== --- head/net-mgmt/grok_exporter/files/grok_exporter.in Thu Jun 7 13:00:19 2018 (r471914) +++ head/net-mgmt/grok_exporter/files/grok_exporter.in Thu Jun 7 13:09:40 2018 (r471915) @@ -16,6 +16,8 @@ # Default is "prometheus". # grok_exporter_group (string): Set group that grok_exporter will run under # Default is "prometheus". +# grok_exporter_log_file (string): Set file that grok_exporter will log to +# Default is "/var/log/grok_exporter.log". . /etc/rc.subr @@ -29,16 +31,20 @@ load_rc_config $name : ${grok_exporter_config:=%%ETCDIR%%/config.yml} : ${grok_exporter_user:=prometheus} : ${grok_exporter_group:=prometheus} +: ${grok_exporter_log_file:=/var/log/grok_exporter.log} pidfile=/var/run/grok_exporter.pid command=/usr/sbin/daemon procname=%%PREFIX%%/bin/grok_exporter -command_args="-p ${pidfile} /usr/bin/env ${procname} -config ${grok_exporter_config}" +command_args="-p ${pidfile} /usr/bin/env ${procname} -config ${grok_exporter_config} >>${grok_exporter_log_file} 2>&1" start_precmd=grok_exporter_startprecmd grok_exporter_startprecmd() { + if [ ! -f "${grok_exporter_log_file}" ]; then + install -o ${grok_exporter_user} -g ${grok_exporter_group} -m 0640 /dev/null ${grok_exporter_log_file}; + fi if [ -e ${pidfile} ]; then chown ${grok_exporter_user}:${grok_exporter_group} ${pidfile}; else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806071309.w57D9e3W021125>