aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorpi <pi@FreeBSD.org>2016-02-07 01:10:57 +0800
committerpi <pi@FreeBSD.org>2016-02-07 01:10:57 +0800
commit46a79be5a5117003f4d316c9dce9f244e7fc9aad (patch)
treea3b08a41134800d01d0f56af921eca512f2cacfd /net-mgmt
parent67f67b3a3ece2e9c082b65f4247dd1305d3a55de (diff)
downloadfreebsd-ports-gnome-46a79be5a5117003f4d316c9dce9f244e7fc9aad.tar.gz
freebsd-ports-gnome-46a79be5a5117003f4d316c9dce9f244e7fc9aad.tar.zst
freebsd-ports-gnome-46a79be5a5117003f4d316c9dce9f244e7fc9aad.zip
net-mgmt/riemann: fix startup script
- use a simple pidfile instead of a whole piddir - add a -Dapp=riemann parameter to java invocation so ps | grep can find riemann easily - remove procname and rely on daemon to handle this - use daemon's pid and not riemanns' pid (-P parent flag change) - add daemon's -r restart flag to keep java running at all costs PR: 204988 Submitted by: David D'Amico <davide.damico@gmail.com> Approved by: Dave Cottlehuber <dch@skunkwerks.at> (maintainer)
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/riemann/Makefile8
-rw-r--r--net-mgmt/riemann/files/riemann.in10
-rw-r--r--net-mgmt/riemann/pkg-plist1
3 files changed, 10 insertions, 9 deletions
diff --git a/net-mgmt/riemann/Makefile b/net-mgmt/riemann/Makefile
index 65c49b301082..0d0941a5a373 100644
--- a/net-mgmt/riemann/Makefile
+++ b/net-mgmt/riemann/Makefile
@@ -3,6 +3,7 @@
PORTNAME= riemann
PORTVERSION= 0.2.10
+PORTREVISION= 1
CATEGORIES= net-mgmt java
MASTER_SITES= https://wintermute.skunkwerks.at/${PORTNAME}/releases/${PORTVERSION}/ \
http://aphyr.com/${PORTNAME}/
@@ -22,13 +23,13 @@ SUB_FILES= ${PORTNAME}
SUB_LIST+= JAVA_HOME=${JAVA_HOME} \
RIEMANN_USER=${RIEMANN_USER} \
RIEMANN_GROUP=${RIEMANN_GROUP} \
- RIEMANN_PIDDIR=${RIEMANN_PIDDIR} \
+ RIEMANN_PIDFILE=${RIEMANN_PIDFILE} \
RIEMANN_LOGDIR=${RIEMANN_LOGDIR}
PLIST_SUB= JAVA_HOME=${JAVA_HOME} \
RIEMANN_USER=${RIEMANN_USER} \
RIEMANN_GROUP=${RIEMANN_GROUP} \
- RIEMANN_PIDDIR=${RIEMANN_PIDDIR} \
+ RIEMANN_PIDFILE=${RIEMANN_PIDFILE} \
RIEMANN_LOGDIR=${RIEMANN_LOGDIR}
RIEMANN_USER?= ${PORTNAME}
@@ -44,13 +45,12 @@ GROUPS= ${PORTNAME}
USE_RC_SUBR= ${PORTNAME}
RIEMANN_LOGDIR= /var/log/${PORTNAME}/
-RIEMANN_PIDDIR= /var/run/${PORTNAME}/
+RIEMANN_PIDFILE= /var/run/${PORTNAME}.pid
do-install:
${MKDIR} \
${STAGEDIR}${JAVAJARDIR} \
${STAGEDIR}${ETCDIR} \
- ${STAGEDIR}${RIEMANN_PIDDIR} \
${STAGEDIR}${RIEMANN_LOGDIR}
${INSTALL_DATA} \
${WRKSRC}/lib/${PORTNAME}.jar \
diff --git a/net-mgmt/riemann/files/riemann.in b/net-mgmt/riemann/files/riemann.in
index 6519aac0a3cd..6c833aa2cd99 100644
--- a/net-mgmt/riemann/files/riemann.in
+++ b/net-mgmt/riemann/files/riemann.in
@@ -36,6 +36,7 @@ load_rc_config $name
: ${riemann_min_mem:="256m"}
: ${riemann_max_mem:="1g"}
: ${riemann_java_opts:=" -server \
+ -Dapp=${name} \
-Xms${riemann_min_mem} \
-Xmx${riemann_max_mem} \
-Xss256k \
@@ -53,16 +54,17 @@ load_rc_config $name
-XX:+UseParNewGC \
-XX:CMSInitiatingOccupancyFraction=75 "}
-riemann_pidfile="%%RIEMANN_PIDDIR%%${name}.pid"
+pidfile="%%RIEMANN_PIDFILE%%"
command="/usr/sbin/daemon"
-procname="${riemann_java_home}/bin/java"
-command_args="-f -c -p ${riemann_pidfile} ${procname} ${riemann_java_opts} \
+command_args="-f -c -r -P ${pidfile} \
+ ${riemann_java_home}/bin/java \
+ ${riemann_java_opts} \
-jar ${riemann_jarfile} ${riemann_config}"
required_files="${java_cmd} ${riemann_config}"
riemann_prestart()
{
- install -o ${riemann_user} /dev/null ${riemann_pidfile}
+ install -o ${riemann_user} /dev/null ${pidfile}
}
start_precmd=${name}_prestart
diff --git a/net-mgmt/riemann/pkg-plist b/net-mgmt/riemann/pkg-plist
index 8b7d7cb45c85..539ec01e64d6 100644
--- a/net-mgmt/riemann/pkg-plist
+++ b/net-mgmt/riemann/pkg-plist
@@ -1,4 +1,3 @@
%%JAVAJARDIR%%/riemann.jar
@sample %%ETCDIR%%/riemann.config.sample
@dir(%%RIEMANN_USER%%,%%RIEMANN_GROUP%%,0750) %%RIEMANN_LOGDIR%%
-@dir(%%RIEMANN_USER%%,%%RIEMANN_GROUP%%,0750) %%RIEMANN_PIDDIR%%