Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2014 21:16:42 GMT
From:      Dave Cottlehuber <dch@skunkwerks.at>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/189872: port riemann to
Message-ID:  <201405162116.s4GLGg2L022084@cgiserv.freebsd.org>
Resent-Message-ID: <201405162120.s4GLK1fV094333@freefall.freebsd.org>

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

>Number:         189872
>Category:       ports
>Synopsis:       port riemann to
>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 May 16 21:20:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Dave Cottlehuber
>Release:        FreeBSD 10.0R amd64
>Organization:
SkunkWerks
>Environment:
FreeBSD wintermute.skunkwerks.at 10.0-RELEASE-p2 FreeBSD 10.0-RELEASE-p2 #0: Tue Apr 29 17:06:01 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
New port is largely complete, but has an issue I can't nail down. Time to call in the java-trained paratroopers. git branch is also at https://github.com/dch/freebsd-ports/tree/riemann-0.2.5/net-mgmt/riemann

>How-To-Repeat:
I'm not a java developer and I don't see how to set up the rc scripts such that:

- `sudo service riemann start` returns after spawning the JVM
- `sudo service riemann stop` knows how to stop the JVM (kill -9 is fine for this app)

Currently I use:

riemann_start()
{
    JAVA_VERSION="%%JAVA_VERSION%%" \
	exec "%%LOCALBASE%%/bin/java" -jar "%%JAVAJARDIR%%/riemann.jar" "$@"
}

Thanks also to xmj who provided much wisdom, some of which has likely been misunderstood. All errors, etc..

>Fix:


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:
#
#	riemann/
#	riemann//pkg-plist
#	riemann//files
#	riemann//files/riemann.in
#	riemann//Makefile
#	riemann//pkg-descr
#	riemann//distinfo
#
echo c - riemann/
mkdir -p riemann/ > /dev/null 2>&1
echo x - riemann//pkg-plist
sed 's/^X//' >riemann//pkg-plist << 'END-of-riemann//pkg-plist'
X%%JAVAJARDIR%%/riemann.jar
X@sample %%ETCDIR%%/riemann.config.sample
X@exec mkdir %%LOGDIR%%
X@dirrmtry %%ETCDIR%%
END-of-riemann//pkg-plist
echo c - riemann//files
mkdir -p riemann//files > /dev/null 2>&1
echo x - riemann//files/riemann.in
sed 's/^X//' >riemann//files/riemann.in << 'END-of-riemann//files/riemann.in'
X#!/bin/sh
X
X# $FreeBSD$
X#
X# PROVIDE: riemann
X# REQUIRE: LOGIN
X# KEYWORD: shutdown
X#
X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
X# to enable this service:
X#
X# riemann_enable (bool): Set to NO by default.
X# Set it to YES to enable riemann.
X#
X# riemann_config (string): Optional full path for riemann config
X
X. /etc/rc.subr
X
Xname="riemann"
Xrcvar=riemann_enable
X
Xload_rc_config $name
X
X: ${riemann_enable="NO"}
Xriemann_user="${riemann_user:-"riemann"}"
Xriemann_config="${riemann_config:-"%%PREFIX%%/etc/riemann/riemann.config"}"
Xriemann_logdir="${riemann_logdir:-"/var/log/riemann"}"
X
Xcommand="%%PREFIX%%/bin/${name}"
Xcommand_args="${riemann_config}"
Xrequired_files="${riemann_config}"
X
Xriemann_prestart()
X{
X	if ! [ -x {$riemann_logdir} ] ; then
X        mkdir -p 750 "${riemann_logdir}"
X    fi
X    chown -R ${riemann_user}:${riemann_user} "${riemann_logdir}"
X}
X
Xstart_precmd="${name}_prestart"
X
Xriemann_start()
X{
X    JAVA_VERSION="%%JAVA_VERSION%%" \
X	exec "%%LOCALBASE%%/bin/java" -jar "%%JAVAJARDIR%%/riemann.jar" "$@"
X}
X
Xrun_rc_command $1
END-of-riemann//files/riemann.in
echo x - riemann//Makefile
sed 's/^X//' >riemann//Makefile << 'END-of-riemann//Makefile'
X# Created by: Dave Cottlehuber <dch@skunkwerks.at>
X# $FreeBSD$
X
XPORTNAME=	riemann
XPORTVERSION=	0.2.5
XCATEGORIES=	net-mgmt
XMASTER_SITES=	http://aphyr.com/${PORTNAME}/
XLICENSE=	EPL
X
XMAINTAINER=	dch@skunkwerks.at
XCOMMENT=	Riemann monitors distributed systems
X
XUSES=		tar:bzip2
XNO_BUILD=	yes
XNO_ARCH=	yes
XUSE_JAVA=	yes
XJAVA_VERSION=	1.6+
X
XPLIST_SUB=	JAVAJARDIR=${JAVAJARDIR}
X
XSUB_FILES=	${PORTNAME}
X
XUSERS=		${PORTNAME}
XGROUPS=		${PORTNAME}
X
XUSE_RC_SUBR=	${PORTNAME}
X
XLOGDIR=		/var/log/${PORTNAME}
X
Xdo-install:
X	@${MKDIR} ${STAGEDIR}${JAVAJARDIR} ${STAGEDIR}${ETCDIR}
X	${INSTALL_DATA} ${WRKSRC}/lib/${PORTNAME}.jar \
X		${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar
X	@${SED} -i -e "s:riemann.log:/var/log/${PORTNAME}/${PORTNAME}.log:g" \
X		${WRKSRC}/etc/${PORTNAME}.config
X	@${CP} -p ${WRKSRC}/etc/${PORTNAME}.config \
X		${STAGEDIR}${ETCDIR}/${PORTNAME}.config.sample
X
X.include <bsd.port.mk>
END-of-riemann//Makefile
echo x - riemann//pkg-descr
sed 's/^X//' >riemann//pkg-descr << 'END-of-riemann//pkg-descr'
XRiemann provides low-latency, transient shared state for systems with many
Xmoving parts.
X
XRiemann aggregates events from your servers and applications with a powerful
Xstream processing language. Send an email for every exception raised by your
Xcode. Track the latency distribution of your web app. See the top processes
Xon any host, by memory and CPU. Combine statistics from every Riak node in
Xyour cluster and forward to Graphite. Send alerts when a key process fails
Xto check in. Know how many users signed up right this second.
X
XWWW: http://riemann.io/
END-of-riemann//pkg-descr
echo x - riemann//distinfo
sed 's/^X//' >riemann//distinfo << 'END-of-riemann//distinfo'
XSHA256 (riemann-0.2.5.tar.bz2) = fe8b18a59d056a74225f33b9614d095110e66a65e598e74b30aa4171722ef06f
XSIZE   (riemann-0.2.5.tar.bz2) = 31402792
END-of-riemann//distinfo
exit



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



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