diff options
author | rodrigo <rodrigo@FreeBSD.org> | 2018-03-10 18:41:37 +0800 |
---|---|---|
committer | rodrigo <rodrigo@FreeBSD.org> | 2018-03-10 18:41:37 +0800 |
commit | 237978fb868f50910d9034e18cba0ec4d6063ece (patch) | |
tree | 79793f5a166bbfaf1e83ee82a890ce831508bc21 /net-mgmt | |
parent | aba76c9dd653bd8427d9d86346aede25c78fb5ab (diff) | |
download | freebsd-ports-gnome-237978fb868f50910d9034e18cba0ec4d6063ece.tar.gz freebsd-ports-gnome-237978fb868f50910d9034e18cba0ec4d6063ece.tar.zst freebsd-ports-gnome-237978fb868f50910d9034e18cba0ec4d6063ece.zip |
Update net-mgmt/kapacitor from 1.3.2 to 1.4.0
Major changes :
Load TICKscripts and alert handlers from a directory.
Structed Logging with a logging API endpoints to be able to tail logs for given tasks.
Autoscale support for Docker Swarm and EC2 Autoscaling.
Sideload data into your TICKscript streams from external sources.
Fully customizable POST body for the alert POST handler and the httpPost node.
See the complete list of bug fixes and features at
https://github.com/influxdata/kapacitor/blob/master/CHANGELOG.md
PR: 224205
Submitted by: cheffo@freebsd-bg.org (maintainer)
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/kapacitor/Makefile | 66 | ||||
-rw-r--r-- | net-mgmt/kapacitor/distinfo | 6 | ||||
-rw-r--r-- | net-mgmt/kapacitor/files/kapacitord.in | 32 | ||||
-rw-r--r-- | net-mgmt/kapacitor/pkg-plist | 2 |
4 files changed, 78 insertions, 28 deletions
diff --git a/net-mgmt/kapacitor/Makefile b/net-mgmt/kapacitor/Makefile index 29816013f411..d30261cd6434 100644 --- a/net-mgmt/kapacitor/Makefile +++ b/net-mgmt/kapacitor/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= kapacitor -PORTVERSION= 1.3.2 +PORTVERSION= 1.4.0 DISTVERSIONPREFIX= v CATEGORIES= net-mgmt @@ -25,27 +25,50 @@ GH_ACCOUNT= influxdata:DEFAULT #GH_SUBDIR= src/github.com/${GH_ACCOUNT_DEFAULT}/${PORTNAME} SUB_FILES= kapacitord -SUB_LIST+= KAPACITORD_PIDDIR=${KAPACITORD_PIDDIR} -PLIST_SUB= KAPACITORD_PIDDIR=${KAPACITORD_PIDDIR} +SUB_LIST+= KAPACITORD_USER=${KAPACITORD_USER} \ + KAPACITORD_GROUP=${KAPACITORD_GROUP} \ + KAPACITORD_DBDIR=${KAPACITORD_DBDIR} \ + KAPACITORD_LOGDIR=${KAPACITORD_LOGDIR} +PLIST_SUB= KAPACITORD_USER=${KAPACITORD_USER} \ + KAPACITORD_GROUP=${KAPACITORD_GROUP} \ + KAPACITORD_DBDIR=${KAPACITORD_DBDIR} \ + KAPACITORD_LOGDIR=${KAPACITORD_LOGDIR} + +#Use influxd user as it's aleary present in ports system +KAPACITORD_USER= influxd +KAPACITORD_GROUP= influxd + +USERS= ${KAPACITORD_USER} +GROUPS= ${KAPACITORD_GROUP} + +.include <bsd.port.pre.mk> + +.if ${OPSYS} == "FreeBSD" && ((${OSVERSION} >= 1100513 && ${OSVERSION} < 1200000) || \ + ${OSVERSION} >= 1200015) +SUB_LIST+= KAPACITORD_LOGCMD="daemon" +.else +SUB_LIST+= KAPACITORD_LOGCMD="logger" +.endif + +KAPACITORD_DBDIR= /var/db/${PORTNAME}/ +KAPACITORD_LOGDIR= /var/log/${PORTNAME}/ post-patch: @${MKDIR} ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${PORTNAME} @cd ${WRKSRC} && ${MV} \ - BLOB_STORE_DESIGN.md CHANGELOG.md CONTRIBUTING.md DESIGN.md \ - Gopkg.lock Gopkg.toml LICENSE_OF_DEPENDENCIES.md README.md \ - alert alert.go auth batch.go bufpool build.py build.sh \ - circle-test.sh circle.yml client clock cmd combine.go combine_test.go \ - command default.go delete.go derivative.go doc.go edge.go \ - edge_test.go etc eval.go examples expr.go expvar flatten.go \ - gobuild.sh group_by.go http_out.go http_post.go influxdb \ - influxdb_out.go influxql.gen.go influxql.gen.go.tmpl influxql.go \ - integrations join.go k8s_autoscale.go kapacitor_loopback.go \ - list-deps listmap log.go metaclient.go models node.go noop.go \ - output.go pipeline query.go query_test.go replay.go result.go \ - sample.go scripts server services shift.go state_tracking.go \ - stats.go stream.go task.go task_master.go template.go test.sh \ - tick tickdoc.conf timer tmpldata.json udf udf.go udf_test.go \ - union.go update_tick_docs.sh usr uuid vars vendor where.go \ + BLOB_STORE_DESIGN.md CHANGELOG.md CONTRIBUTING.md DESIGN.md Gopkg.lock \ + Gopkg.toml LICENSE_OF_DEPENDENCIES.md README.md alert alert.go auth \ + autoscale.go barrier.go batch.go bufpool build.py build.sh circle-test.sh \ + circle.yml client clock cmd combine.go combine_test.go command default.go \ + delete.go derivative.go doc.go edge edge.go etc eval.go examples expr.go \ + expvar flatten.go gobuild.sh group_by.go http_out.go http_post.go influxdb \ + influxdb_out.go influxql.gen.go influxql.gen.go.tmpl influxql.go integrations \ + join.go kapacitor_loopback.go keyvalue list-deps listmap log.go metaclient.go \ + models node.go noop.go output.go pipeline query.go query_test.go replay.go \ + result.go sample.go scripts server services shift.go sideload.go \ + state_tracking.go stats.go stream.go task.go task_master.go template.go \ + test.sh tick tickdoc.conf timer tlsconfig tmpldata.json udf udf.go \ + udf_test.go union.go update_tick_docs.sh usr uuid vendor waiter where.go \ window.go window_test.go \ ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${PORTNAME} @@ -55,10 +78,15 @@ do-build: && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go install -ldflags "-X main.version=${DISTVERSION}" ./cmd/${PORTNAME}d do-install: + ${MKDIR} ${STAGEDIR}${KAPACITORD_DBDIR} \ + ${STAGEDIR}${KAPACITORD_LOGDIR} ${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME}d ${STAGEDIR}${PREFIX}/bin/${PORTNAME}d + @${SED} -i .bak -e \ + "s|/var/lib/kapacitor|/var/db/kapacitor|g" \ + ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}/etc/${PORTNAME}/${PORTNAME}.conf ${INSTALL_DATA} \ ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}/etc/${PORTNAME}/${PORTNAME}.conf \ ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/net-mgmt/kapacitor/distinfo b/net-mgmt/kapacitor/distinfo index ebaae46ffb3c..ab6824a9407b 100644 --- a/net-mgmt/kapacitor/distinfo +++ b/net-mgmt/kapacitor/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1511467900 -SHA256 (influxdata-kapacitor-v1.3.2_GH0.tar.gz) = bdd53ab115c36905edbe1026ca8a14595c2ee2703380cd06366d1599c0db8806 -SIZE (influxdata-kapacitor-v1.3.2_GH0.tar.gz) = 7039627 +TIMESTAMP = 1520602174 +SHA256 (influxdata-kapacitor-v1.4.0_GH0.tar.gz) = 3c448eec9fb26581d9074a9fca4593d7aa7a19e4934cc392b5a345fad90edbeb +SIZE (influxdata-kapacitor-v1.4.0_GH0.tar.gz) = 7542927 diff --git a/net-mgmt/kapacitor/files/kapacitord.in b/net-mgmt/kapacitor/files/kapacitord.in index e8ef5bdb0e51..10cd9c1b91fa 100644 --- a/net-mgmt/kapacitor/files/kapacitord.in +++ b/net-mgmt/kapacitor/files/kapacitord.in @@ -9,11 +9,11 @@ # Add the following lines to /etc/rc.conf to enable telegrafb: # kapacitord_enable="YES" # -# kapacitord_enable (bool): Set to YES to enable telegraf +# kapacitord_enable (bool): Set to YES to enable kapacitord # Default: NO -# kapacitord_conf (str): telegraf configuration file -# Default: ${PREFIX}/etc/telegraf.conf -# kapacitord_flags (str): Extra flags passed to telegraf +# kapacitord_conf (str): kapacitord configuration file +# Default: ${PREFIX}/etc/kapacitord.conf +# kapacitord_flags (str): Extra flags passed to kapacitord . /etc/rc.subr @@ -22,14 +22,34 @@ rcvar=kapacitord_enable load_rc_config $name : ${kapacitord_enable:="NO"} +: ${kapacitord_user:="%%KAPACITORD_USER%%"} +: ${kapacitord_group:="%%KAPACITORD_GROUP%%"} +: ${kapacitord_facility:="daemon"} +: ${kapacitord_priority:="info"} : ${kapacitord_flags:=""} : ${kapacitord_conf:="%%PREFIX%%/etc/kapacitor.conf"} +: ${kapacitord_options:="${kapacitord_flags} -config=${kapacitord_conf}"} # daemon start_precmd=kapacitord_prestart -pidfile="/var/run/${name}.pid" +kapacitord_pidfile="/var/run/${name}.pid" +procname="%%PREFIX%%/bin/${name}" command=/usr/sbin/daemon -command_args="-f -crP ${pidfile} %%PREFIX%%/bin/${name} ${kapacitord_flags} -config=${kapacitord_conf} >> /var/log/kapacitord.log 2>&1" ++start_cmd="kapacitord_startcmd_%%KAPACITORD_LOGCMD%%" + +kapacitord_startcmd_daemon() +{ + echo "Starting ${name}." + /usr/sbin/daemon -c -p ${kapacitord_pidfile} -S -s ${kapacitord_priority} -l ${kapacitord_facility} \ + -u ${kapacitord_user} ${procname} ${kapacitord_options} +} + +kapacitord_startcmd_logger() +{ + echo "Starting ${name}." + /usr/sbin/daemon -c -p ${kapacitord_pidfile} -u ${kapacitord_user} /bin/sh -c "${procname} ${kapacitord_options} 2>&1 \ + | /usr/bin/logger -t ${name} -p ${kapacitord_facility}.${kapacitord_priority}" +} kapacitord_prestart() { # Have to empty rc_flags so they don't get passed to daemon(8) diff --git a/net-mgmt/kapacitor/pkg-plist b/net-mgmt/kapacitor/pkg-plist index 43e4cc63df26..a696491a9171 100644 --- a/net-mgmt/kapacitor/pkg-plist +++ b/net-mgmt/kapacitor/pkg-plist @@ -1,3 +1,5 @@ bin/kapacitor bin/kapacitord +@dir(%%KAPACITORD_USER%%,%%KAPACITORD_GROUP%%,0750) %%KAPACITORD_DBDIR%% +@dir(%%KAPACITORD_USER%%,%%KAPACITORD_GROUP%%,0750) %%KAPACITORD_LOGDIR%% @sample etc/kapacitor.conf.sample |