Re: [update] telegraf 1.9.4

2019-02-22 Thread Joel Carnat
On Fri 22/02 16:26, Landry Breuil wrote:
> Hi,
> 
> here's an update to telegraf 1.9.4, now using sysutils/dep instead of go
> get to fetch 'dep' (which produced broken results) - changed mode/group
> ownership of the @sampled config file as it might contain credentials,
> as noted by Joel Carnat (thanks !). made it root:_telegraf 0640 as
> theres no need for telegraf itself to write its config file.
> 
> I again had to jump through hoops to 'fix' EINVAL when using
> inputs.system plugin, overwriting the bundled x/sys module by the port
> source helps.. go ecosystem is tiring.
> 
> if it works for you, fine :) as i dont really use it, dont count on me
> to care much more about it..
> 
> Landry

Hi,

Thanks for the update! I just compiled it and installed on two servers.
So far, it seems to be working great.

Not sure if that's relevant as I may have had an old 1.9.0 WIP archive.
But in case it is, I got a reject on the Makefile while patching.
And I had to manually replace the V variable:
--- Makefile.orig   Fri Dec  7 09:25:48 2018
+++ MakefileFri Feb 22 16:53:27 2019
@@ -3,9 +3,9 @@
 COMMENT =  plugin-driven server agent for collecting metrics

-V =1.9.0
+V =1.9.4
 DISTNAME = telegraf-${V}
 GH_ACCOUNT =   influxdata

Regards,
  Jo
@@ -40,8 +45,7 @@
mkdir -p ${WRKDIR}/go/src/github.com/influxdata/
ftp -o ${WRKDIR}/${DISTFILES} 
https://github.com/influxdata/telegraf/archive/${GH_TAGNAME}/${DISTFILES}
tar -C ${WRKDIR}/go/src/github.com/influxdata/ -xzf 
${WRKDIR}/${DISTFILES}
-   ${SETENV} ${MODGO_ENV} go get github.com/golang/dep/cmd/dep
-   cd ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME} && ${SETENV} 
${MODGO_ENV} ${WRKDIR}/go/bin/dep ensure
+   cd ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME} && ${SETENV} 
${MODGO_ENV} ${TRUEPREFIX}/bin/dep ensure
rm -Rf ${WRKDIR}/go/{bin,pkg} 
${WRKDIR}/go/src/github.com/influxdata/${DISTNAME}/vendor/github.com/influxdata/telegraf
 ${WRKDIR}/${DISTFILES}
cd ${WRKDIR}/go/src/github.com/influxdata/ && tar -czf 
/usr/ports/distfiles/${DISTFILES} ${DISTNAME}
 


[update] telegraf 1.9.4

2019-02-22 Thread Landry Breuil
Hi,

here's an update to telegraf 1.9.4, now using sysutils/dep instead of go
get to fetch 'dep' (which produced broken results) - changed mode/group
ownership of the @sampled config file as it might contain credentials,
as noted by Joel Carnat (thanks !). made it root:_telegraf 0640 as
theres no need for telegraf itself to write its config file.

I again had to jump through hoops to 'fix' EINVAL when using
inputs.system plugin, overwriting the bundled x/sys module by the port
source helps.. go ecosystem is tiring.

if it works for you, fine :) as i dont really use it, dont count on me
to care much more about it..

Landry
? Makefile.deps
Index: Makefile
===
RCS file: /cvs/ports/sysutils/telegraf/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile25 Dec 2018 22:40:11 -  1.2
+++ Makefile22 Feb 2019 15:25:07 -
@@ -6,7 +6,7 @@
 
 GH_ACCOUNT =   influxdata
 GH_PROJECT =   telegraf
-GH_TAGNAME =   1.9.0
+GH_TAGNAME =   1.9.4
 HOMEPAGE = https://influxdata.com
 # selfhosted because we bundle go deps
 MASTER_SITES = https://rhaalovely.net/stuff/
@@ -18,14 +18,19 @@
 
 MODULES =  lang/go
 
-# dep rebundles them..
-#BUILD_DEPENDS =   security/go-crypto \
-#  textproc/go-text \
-#  devel/go-sys \
-#  net/go-net
+BUILD_DEPENDS =sysutils/dep \
+   security/go-crypto \
+   textproc/go-text \
+   devel/go-sys \
+   net/go-net
 
 WANTLIB += c pthread
 
+# overwrite vendored versions with known-working ones
+post-extract:
+   rm -Rf ${WRKDIST}/vendor/golang.org/x/{sys,text,net,crypto}
+   cp -r ${TRUEPREFIX}/go-pkg/src/golang.org/x/{sys,text,net,crypto} 
${WRKDIST}/vendor/golang.org/x/
+
 do-install:
${MODGO_INSTALL_TARGET}
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/telegraf/
@@ -40,8 +45,7 @@
mkdir -p ${WRKDIR}/go/src/github.com/influxdata/
ftp -o ${WRKDIR}/${DISTFILES} 
https://github.com/influxdata/telegraf/archive/${GH_TAGNAME}/${DISTFILES}
tar -C ${WRKDIR}/go/src/github.com/influxdata/ -xzf 
${WRKDIR}/${DISTFILES}
-   ${SETENV} ${MODGO_ENV} go get github.com/golang/dep/cmd/dep
-   cd ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME} && ${SETENV} 
${MODGO_ENV} ${WRKDIR}/go/bin/dep ensure
+   cd ${WRKDIR}/go/src/github.com/influxdata/${DISTNAME} && ${SETENV} 
${MODGO_ENV} ${TRUEPREFIX}/bin/dep ensure
rm -Rf ${WRKDIR}/go/{bin,pkg} 
${WRKDIR}/go/src/github.com/influxdata/${DISTNAME}/vendor/github.com/influxdata/telegraf
 ${WRKDIR}/${DISTFILES}
cd ${WRKDIR}/go/src/github.com/influxdata/ && tar -czf 
/usr/ports/distfiles/${DISTFILES} ${DISTNAME}
 
Index: distinfo
===
RCS file: /cvs/ports/sysutils/telegraf/distinfo,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 distinfo
--- distinfo18 Dec 2018 19:31:28 -  1.1.1.1
+++ distinfo22 Feb 2019 15:25:07 -
@@ -1,2 +1,2 @@
-SHA256 (telegraf-1.9.0.tar.gz) = MCBAuASXvOAVU5luKO1w4dBrzcbQrfkXPg2MpurOv7I=
-SIZE (telegraf-1.9.0.tar.gz) = 67990016
+SHA256 (telegraf-1.9.4.tar.gz) = 4uEr3BIwQ6LhhfKAMJsFvviK2dWHJfh4y+ER6CuaQNM=
+SIZE (telegraf-1.9.4.tar.gz) = 68006810
Index: pkg/PLIST
===
RCS file: /cvs/ports/sysutils/telegraf/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 PLIST
--- pkg/PLIST   18 Dec 2018 19:31:28 -  1.1.1.1
+++ pkg/PLIST   22 Feb 2019 15:25:07 -
@@ -8,4 +8,6 @@
 share/examples/telegraf/
 @sample ${SYSCONFDIR}/telegraf/
 share/examples/telegraf/telegraf.conf
+@mode 640
+@group _telegraf
 @sample ${SYSCONFDIR}/telegraf/telegraf.conf