Date: Wed, 25 Sep 2019 20:03:48 +0000 (UTC) From: Craig Leres <leres@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r512808 - in head/net-mgmt/telegraf: . files Message-ID: <201909252003.x8PK3mBW055750@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: leres Date: Wed Sep 25 20:03:48 2019 New Revision: 512808 URL: https://svnweb.freebsd.org/changeset/ports/512808 Log: net-mgmt/telegraf: Add a rc.conf option for the --config-directory option While we're here: - Sort ONLY_FOR_ARCHS as per portlint - Match "telegraf -h" usage message (-quiet, -config -> --quiet, --config) PR: 239291 Approved by: girgen (maintainer timeout, 9 weeks), matthew (mentor, implicit) Modified: head/net-mgmt/telegraf/Makefile head/net-mgmt/telegraf/files/telegraf.in Modified: head/net-mgmt/telegraf/Makefile ============================================================================== --- head/net-mgmt/telegraf/Makefile Wed Sep 25 19:49:13 2019 (r512807) +++ head/net-mgmt/telegraf/Makefile Wed Sep 25 20:03:48 2019 (r512808) @@ -3,6 +3,7 @@ PORTNAME= telegraf DISTVERSION= 1.12.1 +PORTREVISION= 1 CATEGORIES= net-mgmt MAINTAINER= girgen@FreeBSD.org @@ -10,7 +11,7 @@ COMMENT= Time-series data collection LICENSE= MIT -ONLY_FOR_ARCHS= amd64 i386 armv6 armv7 +ONLY_FOR_ARCHS= amd64 armv6 armv7 i386 USES= go Modified: head/net-mgmt/telegraf/files/telegraf.in ============================================================================== --- head/net-mgmt/telegraf/files/telegraf.in Wed Sep 25 19:49:13 2019 (r512807) +++ head/net-mgmt/telegraf/files/telegraf.in Wed Sep 25 20:03:48 2019 (r512808) @@ -13,12 +13,14 @@ # Default: NO # telegraf_conf (str): telegraf configuration file # Default: ${PREFIX}/etc/telegraf.conf +# telegraf_confdir (str): telegraf configuration directory +# Default: none # telegraf_user (str): telegraf daemon user # Default: %%TELEGRAF_USER%% # telegraf_group (str): telegraf daemon group # Default: %%TELEGRAF_GROUP%% # telegraf_flags (str): Extra flags passed to telegraf -# Default: -quiet +# Default: --quiet . /etc/rc.subr @@ -31,9 +33,14 @@ load_rc_config $name : ${telegraf_enable:="NO"} : ${telegraf_user:="%%TELEGRAF_USER%%"} : ${telegraf_group:="%%TELEGRAF_GROUP%%"} -: ${telegraf_flags:="-quiet"} +: ${telegraf_flags:="--quiet"} : ${telegraf_conf:="%%PREFIX%%/etc/${name}.conf"} -: ${telegraf_options:="${telegraf_flags} -config=${telegraf_conf}"} +: ${telegraph_confdir:=""} +: ${telegraf_options:="${telegraf_flags} --config=${telegraf_conf}"} + +if [ -n "${telegraf_confdir}" ]; then + telegraf_options="${telegraf_options} --config-directory=${telegraf_confdir}" +fi logfile="%%TELEGRAF_LOGDIR%%/${name}.log" pidfile="/var/run/${name}.pid"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909252003.x8PK3mBW055750>