Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2018 07:21:32 +0000 (UTC)
From:      Palle Girgensohn <girgen@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r477056 - in head: . net-mgmt/telegraf net-mgmt/telegraf/files
Message-ID:  <201808130721.w7D7LWD5027183@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: girgen
Date: Mon Aug 13 07:21:32 2018
New Revision: 477056
URL: https://svnweb.freebsd.org/changeset/ports/477056

Log:
  Update telegraf
  
  * Update to 1.7.3
  * Update dependencies
  * Add GH_SUBDIR, remove post-patch target
  * Add i386 arch
  
  Submitted by:	Dmitri Goutnik
  PR:		230543

Added:
  head/net-mgmt/telegraf/files/patch-etc_telegraf-conf
     - copied, changed from r477055, head/net-mgmt/telegraf/files/patch-telegraf-conf
Deleted:
  head/net-mgmt/telegraf/files/patch-telegraf-conf
Modified:
  head/GIDs
  head/UIDs
  head/net-mgmt/telegraf/Makefile
  head/net-mgmt/telegraf/distinfo
  head/net-mgmt/telegraf/files/telegraf.in
  head/net-mgmt/telegraf/pkg-plist

Modified: head/GIDs
==============================================================================
--- head/GIDs	Mon Aug 13 07:17:24 2018	(r477055)
+++ head/GIDs	Mon Aug 13 07:21:32 2018	(r477056)
@@ -824,7 +824,7 @@ _geodns:*:853:
 # free: 881
 # free: 882
 # free: 883
-# free: 884
+telegraf:*:884:
 tcpdump:*:885:
 miniflux:*:886:
 pdagent:*:887:

Modified: head/UIDs
==============================================================================
--- head/UIDs	Mon Aug 13 07:17:24 2018	(r477055)
+++ head/UIDs	Mon Aug 13 07:21:32 2018	(r477056)
@@ -831,6 +831,7 @@ archiva:*:871:871::0:0:Apache Archiva Daemon:/nonexist
 # free: 882
 # free: 883
 # free: 884
+telegraf:*:884:884::0:0:telegraf user:/nonexistent:/usr/sbin/nologin
 tcpdump:*:885:885::0:0:tcpdump user:/nonexistent:/usr/sbin/nologin
 miniflux:*:886:886::0:0:Miniflux:/nonexistent:/usr/sbin/nologin
 pdagent:*:887:887::0:0:PagerDuty Agent:/nonexistent:/usr/sbin/nologin

Modified: head/net-mgmt/telegraf/Makefile
==============================================================================
--- head/net-mgmt/telegraf/Makefile	Mon Aug 13 07:17:24 2018	(r477055)
+++ head/net-mgmt/telegraf/Makefile	Mon Aug 13 07:21:32 2018	(r477056)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	telegraf
-DISTVERSION=	1.6.3
+DISTVERSION=	1.7.3
 CATEGORIES=	net-mgmt
 
 MAINTAINER=	girgen@FreeBSD.org
@@ -10,17 +10,18 @@ COMMENT=	Time-series data collection
 
 LICENSE=	MIT
 
-BUILD_DEPENDS=	go>=1.5.0:lang/go
+ONLY_FOR_ARCHS=	amd64 i386
 
-ONLY_FOR_ARCHS=	amd64
+BUILD_DEPENDS=	go>=1.9:lang/go
 
 USE_RC_SUBR=	telegraf
 
 USE_GITHUB=	yes
 
-GH_ACCOUNT=	influxdata:DEFAULT
+GH_ACCOUNT=	influxdata
+GH_SUBDIR=	src/github.com/${GH_ACCOUNT_DEFAULT}/${GH_PROJECT_DEFAULT}
 GH_TUPLE=	collectd:go-collectd:2ce1445:collectd_org/src/collectd.org \
-		aerospike:aerospike-client-go:9701404:aerospike_client_go/src/github.com/aerospike/aerospike-client-go \
+		aerospike:aerospike-client-go:95e1ad7:aerospike_client_go/src/github.com/aerospike/aerospike-client-go \
 		amir:raidman:c74861f:raidman/src/github.com/amir/raidman \
 		apache:thrift:4aaa92ec:thrift/src/github.com/apache/thrift \
 		aws:aws-sdk-go:c861d27d:aws_sdk_go/src/github.com/aws/aws-sdk-go \
@@ -49,11 +50,12 @@ GH_TUPLE=	collectd:go-collectd:2ce1445:collectd_org/sr
 		golang:protobuf:8ee7999:protobuf/src/github.com/golang/protobuf \
 		golang:snappy:7db9049:snappy/src/github.com/golang/snappy \
 		google:go-cmp:f94e52c:go_cmp/src/github.com/google/go-cmp \
-		gorilla:mux:392c28f:mux/src/github.com/gorilla/mux \
+		gorilla:mux:53c1911:mux/src/github.com/gorilla/mux \
 		hailocab:go-hostpool:e80d13c:go_hostpool/src/github.com/hailocab/go-hostpool \
-		hashicorp:consul:63d2fc68:consul/src/github.com/hashicorp/consul \
+		hashicorp:consul:5174058:consul/src/github.com/hashicorp/consul \
+		influxdata:go-syslog:eecd51d:syslog/src/github.com/influxdata/go-syslog \
 		influxdata:tail:c434825:tail/src/github.com/influxdata/tail \
-		influxdata:toml:5d1d907:toml/src/github.com/influxdata/toml \
+		influxdata:toml:2a2e301:toml/src/github.com/influxdata/toml \
 		influxdata:wlog:7c63b0a:wlog/src/github.com/influxdata/wlog \
 		jackc:pgx:63f58fd:pgx/src/github.com/jackc/pgx \
 		jmespath:go-jmespath:bd40a43:go_jmespath/src/github.com/jmespath/go-jmespath \
@@ -61,13 +63,14 @@ GH_TUPLE=	collectd:go-collectd:2ce1445:collectd_org/sr
 		kardianos:service:6d3a0ee:service/src/github.com/kardianos/service \
 		kballard:go-shellquote:d8ec1a6:go_shellquote/src/github.com/kballard/go-shellquote \
 		matttproud:golang_protobuf_extensions:c12348c:golang_protobuf_extensions/src/github.com/matttproud/golang_protobuf_extensions \
+		Microsoft:ApplicationInsights-Go:3612f58:application_insights/src/github.com/Microsoft/ApplicationInsights-Go \
 		Microsoft:go-winio:ce2922f:go_winio/src/github.com/Microsoft/go-winio \
 		miekg:dns:99f84ae:dns/src/github.com/miekg/dns \
 		mitchellh:mapstructure:d0303fe:mapstructure/src/github.com/mitchellh/mapstructure \
 		multiplay:go-ts3:07477f4:go_ts3/src/github.com/multiplay/go-ts3 \
 		naoina:go-stringutil:6b638e9:go_stringutil/src/github.com/naoina/go-stringutil \
 		nats-io:gnatsd:393bbb7:gnatsd/src/github.com/nats-io/gnatsd \
-		nats-io:go-nats:ea95856:nats/src/github.com/nats-io/nats \
+		nats-io:go-nats:ea95856:nats/src/github.com/nats-io/go-nats \
 		nats-io:nuid:289cccf:nuid/src/github.com/nats-io/nuid \
 		nsqio:go-nsq:eee57a3:go_nsq/src/github.com/nsqio/go-nsq \
 		opencontainers:runc:89ab7f2c:runc/src/github.com/opencontainers/runc \
@@ -90,7 +93,6 @@ GH_TUPLE=	collectd:go-collectd:2ce1445:collectd_org/sr
 		Shopify:sarama:3b1b388:sarama/src/github.com/Shopify/sarama \
 		Sirupsen:logrus:61e43dc:logrus/src/github.com/Sirupsen/logrus \
 		soniah:gosnmp:f15472a:gosnmp/src/github.com/soniah/gosnmp \
-		sparrc:gdm:81089da:gdm/src/github.com/sparrc/gdm \
 		StackExchange:wmi:f3e2bae:wmi/src/github.com/StackExchange/wmi \
 		streadway:amqp:63795da:amqp/src/github.com/streadway/amqp \
 		stretchr:objx:facf9a8:objx/src/github.com/stretchr/objx \
@@ -102,12 +104,13 @@ GH_TUPLE=	collectd:go-collectd:2ce1445:collectd_org/sr
 		wvanbergen:kazoo-go:9689573:kazoo_go/src/github.com/wvanbergen/kazoo-go \
 		yuin:gopher-lua:66c871e:gopher_lua/src/github.com/yuin/gopher-lua \
 		zensqlmonitor:go-mssqldb:ffe5510:go_mssqldb/src/github.com/zensqlmonitor/go-mssqldb \
+		cloudfoundry:clock:e9dc86bb:clock/src/code.cloudfoundry.org/clock \
+		google:go-genproto:11c7f9e:genproto/src/google.golang.org/genproto \
+		grpc:grpc-go:de2209a:grpc/src/google.golang.org/grpc \
 		golang:crypto:dc137be:crypto/src/golang.org/x/crypto \
-		golang:lint:470b6b0:lint/src/golang.org/x/lint \
-		golang:net:f249948:net/src/golang.org/x/net \
+		golang:net:a337091:net/src/golang.org/x/net \
 		golang:sys:7397344:sys/src/golang.org/x/sys \
 		golang:text:506f9d5:text/src/golang.org/x/text \
-		golang:tools:a5b4c53f:tools/src/golang.org/x/tools \
 		fatih:pool:6e328e6:pool_v2/src/gopkg.in/fatih/pool.v2 \
 		gorethink:gorethink:7ab832f:gorethink_v3/src/gopkg.in/gorethink/gorethink.v3 \
 		go-asn1-ber:asn1-ber:4e86f43:asn1_ber/src/gopkg.in/asn1-ber.v1 \
@@ -118,25 +121,30 @@ GH_TUPLE=	collectd:go-collectd:2ce1445:collectd_org/sr
 		go-yaml:yaml:4c78c97:yaml/src/gopkg.in/yaml.v2
 
 SUB_FILES=	telegraf
-SUB_LIST+=	TELEGRAF_PIDDIR=${TELEGRAF_PIDDIR}
-PLIST_SUB=	TELEGRAF_PIDDIR=${TELEGRAF_PIDDIR}
+SUB_LIST=	TELEGRAF_USER=${TELEGRAF_USER} \
+		TELEGRAF_GROUP=${TELEGRAF_GROUP} \
+		TELEGRAF_LOGDIR=${TELEGRAF_LOGDIR}
+PLIST_SUB=	TELEGRAF_USER=${TELEGRAF_USER} \
+		TELEGRAF_GROUP=${TELEGRAF_GROUP} \
+		TELEGRAF_LOGDIR=${TELEGRAF_LOGDIR}
 
-post-patch:
-	@${MKDIR} ${WRKSRC}/src/github.com/${GH_ACCOUNT_DEFAULT}/${PORTNAME}
-	@cd ${WRKSRC} && ${MV} appveyor.yml CHANGELOG.md CONTRIBUTING.md Godeps \
-		LICENSE Makefile README.md accumulator.go agent aggregator.go cmd docs etc filter \
-		input.go internal logger metric metric.go output.go plugins processor.go scripts selfstat testutil \
-		${WRKSRC}/src/github.com/${GH_ACCOUNT_DEFAULT}/${PORTNAME}
-	${LN} -s nats ${WRKSRC}/src/github.com/nats-io/go-nats
+TELEGRAF_USER=	telegraf
+TELEGRAF_GROUP=	telegraf
 
+USERS=		${TELEGRAF_USER}
+GROUPS=		${TELEGRAF_GROUP}
+
+TELEGRAF_LOGDIR=/var/log/${PORTNAME}
+
 do-build:
-	@cd ${WRKSRC}/src/github.com/influxdata/${PORTNAME} && \
-		${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go install -ldflags "-X main.version=${DISTVERSION}" ./...
+	@cd ${WRKSRC}/${GH_SUBDIR} && \
+		${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go install -ldflags "-X main.version=${DISTVERSION}" ./cmd/telegraf
 
 do-install:
+	${MKDIR} ${STAGEDIR}${TELEGRAF_LOGDIR}
 	${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
 	${INSTALL_DATA} \
-		${WRKSRC}/src/github.com/${GH_ACCOUNT_DEFAULT}/${GH_PROJECT}/etc/${PORTNAME}.conf  \
+		${WRKSRC}/${GH_SUBDIR}/etc/${PORTNAME}.conf  \
 		${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
 
 .include <bsd.port.mk>

Modified: head/net-mgmt/telegraf/distinfo
==============================================================================
--- head/net-mgmt/telegraf/distinfo	Mon Aug 13 07:17:24 2018	(r477055)
+++ head/net-mgmt/telegraf/distinfo	Mon Aug 13 07:21:32 2018	(r477056)
@@ -1,10 +1,10 @@
-TIMESTAMP = 1527283073
-SHA256 (influxdata-telegraf-1.6.3_GH0.tar.gz) = 69325313ee07f60bac3df8609e5583cfd1004399ae7dcfe2b8bc311c01df2753
-SIZE (influxdata-telegraf-1.6.3_GH0.tar.gz) = 972680
+TIMESTAMP = 1534004558
+SHA256 (influxdata-telegraf-1.7.3_GH0.tar.gz) = 499e6e923a5cd46138cab08cc60f252aa5c3024f91c24ce33bbd9f3733790ec4
+SIZE (influxdata-telegraf-1.7.3_GH0.tar.gz) = 1074055
 SHA256 (collectd-go-collectd-2ce1445_GH0.tar.gz) = 5d27107b1f84ca89edf2f8a0e75b0b051d5f6a229da1fa90f1f53a6fa4ce7355
 SIZE (collectd-go-collectd-2ce1445_GH0.tar.gz) = 39622
-SHA256 (aerospike-aerospike-client-go-9701404_GH0.tar.gz) = 8f201670622010565a1a6738fa5036dca7ed3a13701338f215638daf65044e7d
-SIZE (aerospike-aerospike-client-go-9701404_GH0.tar.gz) = 242869
+SHA256 (aerospike-aerospike-client-go-95e1ad7_GH0.tar.gz) = bbe30af22410d0bff33f28bdf24c7eab75d9756c310eaca8b9317e090ba4b936
+SIZE (aerospike-aerospike-client-go-95e1ad7_GH0.tar.gz) = 209173
 SHA256 (amir-raidman-c74861f_GH0.tar.gz) = 7b5e6ac2fa53df931c104924957e36fee230b6a575fcfb0dc04b4b34311909d4
 SIZE (amir-raidman-c74861f_GH0.tar.gz) = 6580
 SHA256 (apache-thrift-4aaa92ec_GH0.tar.gz) = b305904b4b3552011ed877ebbf4dbececf50aed89feca9b237975204b4439da9
@@ -61,16 +61,18 @@ SHA256 (golang-snappy-7db9049_GH0.tar.gz) = 75a608d786
 SIZE (golang-snappy-7db9049_GH0.tar.gz) = 62042
 SHA256 (google-go-cmp-f94e52c_GH0.tar.gz) = 9e35190e28f0a91706d73716c1b53c54193f1ba8dbbe42a2faff0c0f2743e5ec
 SIZE (google-go-cmp-f94e52c_GH0.tar.gz) = 55136
-SHA256 (gorilla-mux-392c28f_GH0.tar.gz) = 4084da951af93ba173bd83cf50cfa868877284b03adc4572c0c6d8c6a89098ea
-SIZE (gorilla-mux-392c28f_GH0.tar.gz) = 27834
+SHA256 (gorilla-mux-53c1911_GH0.tar.gz) = 40a0c98661c774a668e1ffde2582c9862d33a6498e86a75c250f98c6ec315b10
+SIZE (gorilla-mux-53c1911_GH0.tar.gz) = 36403
 SHA256 (hailocab-go-hostpool-e80d13c_GH0.tar.gz) = 9c0ca4a9c0bba2ec0f9b3844c0fd65291efcc5530fb5ec517f2cb4054a5049b9
 SIZE (hailocab-go-hostpool-e80d13c_GH0.tar.gz) = 7031
-SHA256 (hashicorp-consul-63d2fc68_GH0.tar.gz) = d02c6e10168beb63ee3b03bccc53a95c57399fa3b4b9dd03a4aaa436bc4b2c52
-SIZE (hashicorp-consul-63d2fc68_GH0.tar.gz) = 5024742
+SHA256 (hashicorp-consul-5174058_GH0.tar.gz) = da68d060f5f24c2957b2a3a47a7614f8747a61c60946905eb6146954753afaed
+SIZE (hashicorp-consul-5174058_GH0.tar.gz) = 11127389
+SHA256 (influxdata-go-syslog-eecd51d_GH0.tar.gz) = 5d536fb158395d8db4aa7dd624e391cef21f6c8129c41df5aa9afec50c5df054
+SIZE (influxdata-go-syslog-eecd51d_GH0.tar.gz) = 105078
 SHA256 (influxdata-tail-c434825_GH0.tar.gz) = 120fe2115e422646cc9b9ba2eb27ce72fe098d59c0833413f2df15d1f76b9c71
 SIZE (influxdata-tail-c434825_GH0.tar.gz) = 38192
-SHA256 (influxdata-toml-5d1d907_GH0.tar.gz) = a02347d4eb34d6823dc39351271d13d78fe1c0de09611cb3ea419f9b82c8be6c
-SIZE (influxdata-toml-5d1d907_GH0.tar.gz) = 34583
+SHA256 (influxdata-toml-2a2e301_GH0.tar.gz) = a8844888dc4da911fc1939826c0abea4609444233874e0066b09584d0c0c8daf
+SIZE (influxdata-toml-2a2e301_GH0.tar.gz) = 34632
 SHA256 (influxdata-wlog-7c63b0a_GH0.tar.gz) = fa60808c1a241f1a6f38f2c9ed40ec4d03ca6bed90d584620b34bfe00eaf94cc
 SIZE (influxdata-wlog-7c63b0a_GH0.tar.gz) = 2714
 SHA256 (jackc-pgx-63f58fd_GH0.tar.gz) = a122d278c7d80c3e1fcdff8dbeaea8d06ba484afee9bcb64acf52ab7a35d31ba
@@ -85,6 +87,8 @@ SHA256 (kballard-go-shellquote-d8ec1a6_GH0.tar.gz) = 3
 SIZE (kballard-go-shellquote-d8ec1a6_GH0.tar.gz) = 4194
 SHA256 (matttproud-golang_protobuf_extensions-c12348c_GH0.tar.gz) = da165c9275b77a0994b815bc7d761dcb2e4799a90fe49eec08d8bdff3a683f48
 SIZE (matttproud-golang_protobuf_extensions-c12348c_GH0.tar.gz) = 37200
+SHA256 (Microsoft-ApplicationInsights-Go-3612f58_GH0.tar.gz) = f93c2839009c35fa5d0651a581eb163b0d6cd273f3845dbca65b72cecf821ffd
+SIZE (Microsoft-ApplicationInsights-Go-3612f58_GH0.tar.gz) = 48556
 SHA256 (Microsoft-go-winio-ce2922f_GH0.tar.gz) = ccf5866ac0da73b8bcc41fddea7ad15afd07aac2446b0003c3871acbaa39ecda
 SIZE (Microsoft-go-winio-ce2922f_GH0.tar.gz) = 67441
 SHA256 (miekg-dns-99f84ae_GH0.tar.gz) = fdfcbc265da82a9187bc876902a9b568bd079642cf79ecae735f69f5fb3429f0
@@ -143,8 +147,6 @@ SHA256 (Sirupsen-logrus-61e43dc_GH0.tar.gz) = 7701ae9c
 SIZE (Sirupsen-logrus-61e43dc_GH0.tar.gz) = 25130
 SHA256 (soniah-gosnmp-f15472a_GH0.tar.gz) = 171f58c0ae488392e4ab5f1015fa2d34edabf6d83f0e265ccf0ce64fdc76eb1d
 SIZE (soniah-gosnmp-f15472a_GH0.tar.gz) = 47326
-SHA256 (sparrc-gdm-81089da_GH0.tar.gz) = af4ba96d271e6a11aa6b961785ebe9340bfbebfadd6ca3eeb91e22ea54e70e97
-SIZE (sparrc-gdm-81089da_GH0.tar.gz) = 8832
 SHA256 (StackExchange-wmi-f3e2bae_GH0.tar.gz) = 0e6a997036147b602b4281b33bbea5fdba51cdc8fa6f23af64aca7dbf280d26a
 SIZE (StackExchange-wmi-f3e2bae_GH0.tar.gz) = 6830
 SHA256 (streadway-amqp-63795da_GH0.tar.gz) = 2d9755ae7e709c9196242b8298e9cc93a7aea7ec51ef90931e0e44e8cd4c06fb
@@ -167,18 +169,20 @@ SHA256 (yuin-gopher-lua-66c871e_GH0.tar.gz) = fcd3a0aa
 SIZE (yuin-gopher-lua-66c871e_GH0.tar.gz) = 148790
 SHA256 (zensqlmonitor-go-mssqldb-ffe5510_GH0.tar.gz) = 864b1b900c73b7243f19eb39f4551bda26d32e5bb33c215fe767111e3d36b1c4
 SIZE (zensqlmonitor-go-mssqldb-ffe5510_GH0.tar.gz) = 449977
+SHA256 (cloudfoundry-clock-e9dc86bb_GH0.tar.gz) = 14112baead141415a9c023d3abff2e00a1db6b00089f48aaa5274af2a61c830d
+SIZE (cloudfoundry-clock-e9dc86bb_GH0.tar.gz) = 8044
+SHA256 (google-go-genproto-11c7f9e_GH0.tar.gz) = 3ec1ecf2a4824458d3257d27e9440b56fa918330f0e35c34e960c2835375a547
+SIZE (google-go-genproto-11c7f9e_GH0.tar.gz) = 1221890
+SHA256 (grpc-grpc-go-de2209a_GH0.tar.gz) = 6b374fe0faa9c594418e8d70045bfaa969c0ab0b7d9bfa5b112e8fc32e3af597
+SIZE (grpc-grpc-go-de2209a_GH0.tar.gz) = 344165
 SHA256 (golang-crypto-dc137be_GH0.tar.gz) = 042e27a5c1428b4d2484aaee249b191f5e4d8685a500a8c37dd1d4c7d0a1ba54
 SIZE (golang-crypto-dc137be_GH0.tar.gz) = 1305867
-SHA256 (golang-lint-470b6b0_GH0.tar.gz) = fb83953a4f8756efeccc3a8e141c0359e01503ab846a4a19d132eaf944d8dc52
-SIZE (golang-lint-470b6b0_GH0.tar.gz) = 31914
-SHA256 (golang-net-f249948_GH0.tar.gz) = 9629e56d7e6b22d8da3fdea4ed2890bbbcc74dc81e4edb16bd05926ffd4e0d76
-SIZE (golang-net-f249948_GH0.tar.gz) = 767930
+SHA256 (golang-net-a337091_GH0.tar.gz) = 08458ebd9e8215bc30b0b0c864256af017615a69fe0e349bf1043253130294d1
+SIZE (golang-net-a337091_GH0.tar.gz) = 925918
 SHA256 (golang-sys-7397344_GH0.tar.gz) = 759eed72cca808869c05f3067f7d2dfe8859930090fb5dfc653b2d947c03e382
 SIZE (golang-sys-7397344_GH0.tar.gz) = 719845
 SHA256 (golang-text-506f9d5_GH0.tar.gz) = 5689051b2c56e543d44d82e85419d6339b0d866ec65eedc946eb1ca64f15ae2b
 SIZE (golang-text-506f9d5_GH0.tar.gz) = 4528849
-SHA256 (golang-tools-a5b4c53f_GH0.tar.gz) = 35500d5007972536b43f55405505517453832d8b1029b3a167ebdea01a2cb18f
-SIZE (golang-tools-a5b4c53f_GH0.tar.gz) = 2270845
 SHA256 (fatih-pool-6e328e6_GH0.tar.gz) = 9f7952f22a28894d828b5588946597d062c59644135f847c52b98e52897c65fb
 SIZE (fatih-pool-6e328e6_GH0.tar.gz) = 4871
 SHA256 (gorethink-gorethink-7ab832f_GH0.tar.gz) = 84d2ebcbea4eaf25bf175c69a9b303a1f095e28019c97c9db4837fcf3e5b37a0

Copied and modified: head/net-mgmt/telegraf/files/patch-etc_telegraf-conf (from r477055, head/net-mgmt/telegraf/files/patch-telegraf-conf)
==============================================================================
--- head/net-mgmt/telegraf/files/patch-telegraf-conf	Mon Aug 13 07:17:24 2018	(r477055, copy source)
+++ head/net-mgmt/telegraf/files/patch-etc_telegraf-conf	Mon Aug 13 07:21:32 2018	(r477056)
@@ -1,5 +1,5 @@
---- etc/telegraf.conf.orig	2017-05-17 15:30:36.311581000 +0200
-+++ etc/telegraf.conf	2017-05-17 15:31:02.168614000 +0200
+--- etc/telegraf.conf.orig	2018-08-07 18:32:57 UTC
++++ etc/telegraf.conf
 @@ -61,7 +61,7 @@
    ##       when interval = "250ms", precision will be "1ms"
    ## Precision will NOT be used for service inputs. It is up to each individual

Modified: head/net-mgmt/telegraf/files/telegraf.in
==============================================================================
--- head/net-mgmt/telegraf/files/telegraf.in	Mon Aug 13 07:17:24 2018	(r477055)
+++ head/net-mgmt/telegraf/files/telegraf.in	Mon Aug 13 07:21:32 2018	(r477056)
@@ -13,7 +13,12 @@
 #				Default: NO
 # telegraf_conf (str):		telegraf configuration file
 #				Default: ${PREFIX}/etc/telegraf.conf
+# 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
 
 . /etc/rc.subr
 
@@ -24,19 +29,40 @@ rcvar=telegraf_enable
 load_rc_config $name
 
 : ${telegraf_enable:="NO"}
+: ${telegraf_user:="%%TELEGRAF_USER%%"}
+: ${telegraf_group:="%%TELEGRAF_GROUP%%"}
 : ${telegraf_flags:="-quiet"}
 : ${telegraf_conf:="%%PREFIX%%/etc/${name}.conf"}
+: ${telegraf_options:="${telegraf_flags} -config=${telegraf_conf}"}
 
-# daemon
-start_precmd=telegraf_prestart
+logfile="%%TELEGRAF_LOGDIR%%/${name}.log"
 pidfile="/var/run/${name}.pid"
 command=/usr/sbin/daemon
-command_args="-crP ${pidfile} %%PREFIX%%/bin/${name} ${telegraf_flags} -config=${telegraf_conf} >> /var/log/telegraf.log 2>&1"
-extra_commands="reload"
+start_precmd="telegraf_prestart"
+start_cmd="telegraf_start"
+stop_cmd="telegraf_stop"
 
-telegraf_prestart() {
-# Have to empty rc_flags so they don't get passed to daemon(8)
-        rc_flags=""
+telegraf_prestart()
+{
+    install -d -o ${telegraf_user} -g ${telegraf_group} -m750 %%TELEGRAF_LOGDIR%%
+}
+
+telegraf_start()
+{
+    echo "Starting ${name}"
+    /usr/sbin/daemon -cr -P ${pidfile} -u ${telegraf_user} \
+        %%PREFIX%%/bin/${name} ${telegraf_options} >> ${logfile} 2>&1
+}
+
+telegraf_stop()
+{
+    if [ -f ${pidfile} ] && procstat $(cat ${pidfile}) >/dev/null 2>&1; then
+        local pid=$(cat ${pidfile})
+        echo "Stopping ${name} (pid=${pid})"
+        kill -- -${pid}
+    else
+        echo "${name} isn't running"
+    fi
 }
 
 run_rc_command "$1"

Modified: head/net-mgmt/telegraf/pkg-plist
==============================================================================
--- head/net-mgmt/telegraf/pkg-plist	Mon Aug 13 07:17:24 2018	(r477055)
+++ head/net-mgmt/telegraf/pkg-plist	Mon Aug 13 07:21:32 2018	(r477056)
@@ -1,2 +1,3 @@
 bin/telegraf
+@dir(%%TELEGRAF_USER%%,%%TELEGRAF_GROUP%%,0750) %%TELEGRAF_LOGDIR%%
 @sample etc/telegraf.conf.sample



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808130721.w7D7LWD5027183>