mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-04 06:15:24 +00:00
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)
This commit is contained in:
parent
d48a5e206d
commit
2a32387f11
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=408306
@ -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 \
|
||||
|
@ -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
|
||||
|
||||
|
@ -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%%
|
||||
|
Loading…
Reference in New Issue
Block a user