Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2012 20:10:50 GMT
From:      Kimo Rosenbaum <kimor79@yahoo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/171855: [NEW PORT] net-mgmt/node-statsd - Simple daemon for easy stats aggregation
Message-ID:  <201209212010.q8LKAo1w060151@red.freebsd.org>
Resent-Message-ID: <201209212020.q8LKK3Aw084023@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171855
>Category:       ports
>Synopsis:       [NEW PORT] net-mgmt/node-statsd - Simple daemon for easy stats aggregation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 21 20:20:02 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Kimo Rosenbaum
>Release:        9.0-RELEASE
>Organization:
>Environment:
9.0-RELEASE
>Description:
New port: statsd

A network daemon that runs on the Node.js platform and listens for statistics,
like counters and timers, sent over UDP and sends aggregates to one or more
pluggable backend services (e.g., Graphite).

WWW: https://github.com/etsy/statsd
>How-To-Repeat:

>Fix:
See attached shar. Also diff of UIDs and GIDs:

diff --git a/GIDs b/GIDs
index ba40490..a2283db 100644
--- a/GIDs
+++ b/GIDs
@@ -186,6 +186,7 @@ jenkins:*:818:
 openacs:*:820:
 dotlrn:*:821:
 polw:*:825:
+statsd:*:826:
 netdisco:*:840:
 munin:*:842:
 dahdi:*:843:asterisk
diff --git a/UIDs b/UIDs
index 154eea8..cc27d25 100644
--- a/UIDs
+++ b/UIDs
@@ -192,6 +192,7 @@ jenkins:*:818:818::0:0:Jenkins CI:/usr/local/jenkins:/usr/sbin/nologin
 openacs:*:820:820::0:0:OpenACS Daemon User:/nonexistent:/usr/sbin/nologin
 dotlrn:*:821:821::0:0:.LRN Daemon User:/nonexistent:/usr/sbin/nologin
 polw:*:825:825::0:0:Policyd-weight Cache Owner:/nonexistent:/sbin/nologin
+statsd:*:826:826::0:0:Statsd Daemon:/nonexistent:/sbin/nologin
 netdisco:*:840:840::0:0:netdisco daemon:/nonexistent:/usr/sbin/nologin
 munin:*:842:842::0:0:Munin:/var/munin:/usr/sbin/nologin
 fossy:*:901:901::0:0:FOSSology user:/usr/local/share/fossology:/usr/local/bin/bash

Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	node-statsd
#	node-statsd/Makefile
#	node-statsd/distinfo
#	node-statsd/files
#	node-statsd/files/statsd.in
#	node-statsd/pkg-descr
#	node-statsd/pkg-plist
#
echo c - node-statsd
mkdir -p node-statsd > /dev/null 2>&1
echo x - node-statsd/Makefile
sed 's/^X//' >node-statsd/Makefile << 'END-of-node-statsd/Makefile'
XPORTNAME=	statsd
XPORTVERSION=	0.5.0
XCATEGORIES=	net-mgmt
XPKGNAMEPREFIX=	node-
XDISTVERSION=	v0.5.0
X
XMAINTAINER=	kimor79@yahoo.com
XCOMMENT=Simple daemon for easy stats aggregation
X
XUSE_GITHUB=	yes
XGH_ACCOUNT=	etsy
XGH_COMMIT=	712dcfb
X
XNO_BUILD=	yes
X
XRUN_DEPENDS=	node:${PORTSDIR}/www/node
X
XUSERS=		statsd
XGROUPS=		statsd
XUSE_RC_SUBR=	statsd
X
Xpost-patch:
X	@${REINPLACE_CMD} \
X		-e 's;\./;${DATADIR}/;' \
X		${WRKSRC}/stats.js
X
Xdo-install:
X	${MKDIR} ${DATADIR}/backends
X	(cd ${WRKSRC}/backends/ && ${COPYTREE_SHARE} \* ${DATADIR}/backends)
X	${MKDIR} ${DATADIR}/lib
X	(cd ${WRKSRC}/lib/ && ${COPYTREE_SHARE} \* ${DATADIR}/lib)
X	${CP} ${WRKSRC}/config.js ${DATADIR}/config.js
X	${CP} ${WRKSRC}/stats.js ${DATADIR}/stats.js
X
Xpost-install:
X	${INSTALL} -m 0755 -o statsd -g statsd -d /var/run/statsd
X	@${INSTALL_DATA} ${WRKSRC}/exampleConfig.js \
X		${PREFIX}/etc/statsd.js.sample
X	@[ -f ${PREFIX}/etc/statsd.js ] || \
X		${CP} ${PREFIX}/etc/statsd.js.sample \
X		${PREFIX}/etc/statsd.js
X
X.include <bsd.port.mk>
END-of-node-statsd/Makefile
echo x - node-statsd/distinfo
sed 's/^X//' >node-statsd/distinfo << 'END-of-node-statsd/distinfo'
XSHA256 (statsd-v0.5.0.tar.gz) = 9c116085acf7026b48a5bd0f8e7f2e6e0fc642556d38d4b5e2166905fa2727e8
XSIZE (statsd-v0.5.0.tar.gz) = 27391
END-of-node-statsd/distinfo
echo c - node-statsd/files
mkdir -p node-statsd/files > /dev/null 2>&1
echo x - node-statsd/files/statsd.in
sed 's/^X//' >node-statsd/files/statsd.in << 'END-of-node-statsd/files/statsd.in'
X#!/bin/sh
X
X# PROVIDE: statsd
X# REQUIRE: LOGIN
X# KEYWORD: shutdown
X
X#
X# Add the following line to /etc/rc.conf to enable mysql:
X# statsd_enable (bool):	Set to "NO" by default.
X#			Set it to "YES" to enable statsd.
X# statsd_config (str):	Default to "%%PREFIX%%/etc/statsd.js"
X#			Statsd configuration file.
X# statsd_user (str):	Default to "statsd".
X#			User to run as.
X
X. "/etc/rc.subr"
X
Xname="statsd"
Xrcvar=`set_rcvar`
Xload_rc_config $name
X
X# set defaults
X: ${statsd_enable:="NO"}
X: ${statsd_config:="%%PREFIX%%/etc/statsd.js"}
X: ${statsd_user:="statsd"}
X
Xpidfile="/var/run/statsd/${name}.pid"
X
Xrequired_files="${statsd_config}"
X
Xcommand="/usr/sbin/daemon"
Xcommand_args="-cf -p ${pidfile} %%PREFIX%%/bin/node %%DATADIR%%/stats.js ${statsd_config}"
Xprocname="%%PREFIX%%/bin/node"
Xstop_postcmd=stop_postcmd
X
Xstop_postcmd() {
X	rm -f $pidfile
X}
X
Xrun_rc_command "$1"
END-of-node-statsd/files/statsd.in
echo x - node-statsd/pkg-descr
sed 's/^X//' >node-statsd/pkg-descr << 'END-of-node-statsd/pkg-descr'
XA network daemon that runs on the Node.js platform and listens for statistics,
Xlike counters and timers, sent over UDP and sends aggregates to one or more
Xpluggable backend services (e.g., Graphite).
X
XWWW: https://github.com/etsy/statsd
END-of-node-statsd/pkg-descr
echo x - node-statsd/pkg-plist
sed 's/^X//' >node-statsd/pkg-plist << 'END-of-node-statsd/pkg-plist'
X%%DATADIR%%/config.js
X%%DATADIR%%/stats.js
X%%DATADIR%%/backends/console.js
X%%DATADIR%%/backends/graphite.js
X%%DATADIR%%/lib/logger.js
X@unexec if cmp -s %D/etc/statsd.js.sample %D/etc/statsd.js; then rm -f %D/etc/statsd.js; fi
Xetc/statsd.js.sample
X@exec [ -f %B/statsd.js ] || cp %B/%f %B/statsd.js
X@unexec rmdir /var/run/statsd 2>/dev/null || true
X@exec /bin/mkdir -p /var/run/statsd
X@exec /usr/sbin/chown -Rh statsd:statsd /var/run/statsd
X@dirrmtry %%DATADIR%%/lib
X@dirrmtry %%DATADIR%%/backends
X@dirrmtry %%DATADIR%%
END-of-node-statsd/pkg-plist
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



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