FreeBSD Bugzilla – Attachment 163804 Details for
Bug 204988
net-mgmt/riemann: Startup script doesn't work if more than one java process is running
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Riemann startup script patch
riemann_rc.diff (text/plain), 3.15 KB, created by
Davide D'Amico
on 2015-12-03 08:38:52 UTC
(
hide
)
Description:
Riemann startup script patch
Filename:
MIME Type:
Creator:
Davide D'Amico
Created:
2015-12-03 08:38:52 UTC
Size:
3.15 KB
patch
obsolete
>diff -ruh riemann.orig/files/riemann.in riemann/files/riemann.in >--- riemann.orig/files/riemann.in 2015-02-27 14:35:09.000000000 -0500 >+++ riemann/files/riemann.in 2015-12-03 03:36:46.418837000 -0500 >@@ -28,11 +28,11 @@ > load_rc_config $name > > : ${riemann_enable="NO"} >-: ${riemann_user:="%%RIEMANN_USER%%"} >-: ${riemann_group:="%%RIEMANN_GROUP%%"} >-: ${riemann_config:="%%PREFIX%%/etc/riemann/riemann.config.sample"} >-: ${riemann_jarfile:="%%JAVAJARDIR%%/riemann.jar"} >-: ${riemann_java_home:="%%JAVA_HOME%%"} >+: ${riemann_user:="riemann"} >+: ${riemann_group:="riemann"} >+: ${riemann_config:="/usr/local/etc/riemann/riemann.config.sample"} >+: ${riemann_jarfile:="/usr/local/share/java/classes/riemann.jar"} >+: ${riemann_java_home:="/usr/local/openjdk7"} > : ${riemann_min_mem:="256m"} > : ${riemann_max_mem:="1g"} > : ${riemann_java_opts:=" -server \ >@@ -53,12 +53,15 @@ > -XX:+UseParNewGC \ > -XX:CMSInitiatingOccupancyFraction=75 "} > >-riemann_pidfile="%%RIEMANN_PIDDIR%%${name}.pid" >+riemann_pidfile="/var/run/riemann/${name}.pid" > command="/usr/sbin/daemon" > procname="${riemann_java_home}/bin/java" > command_args="-f -c -p ${riemann_pidfile} ${procname} ${riemann_java_opts} \ > -jar ${riemann_jarfile} ${riemann_config}" > required_files="${java_cmd} ${riemann_config}" >+status_cmd="riemann_status" >+start_cmd="riemann_start" >+stop_cmd="riemann_stop" > > riemann_prestart() > { >@@ -66,4 +69,72 @@ > } > start_precmd=${name}_prestart > >+riemann_start() >+{ >+ check_if_running=$(/usr/local/bin/jps | grep ${name} | awk '{print $1}') >+ if [ ! -z "${check_if_running}" ]; then >+ echo "${name} seems running (pid: ${check_if_running})." >+ return 1 >+ fi >+ >+ rc_pid=$(riemann_check_pidfile $riemann_pidfile) >+ if [ -z "$rc_pid" ]; then >+ echo "Starting ${name}." >+ ${command} ${command_args} >+ else >+ echo "${name} seems running ($rc_pid)." >+ return 1 >+ fi >+ >+} >+ >+riemann_status() >+{ >+ rc_pid=$(riemann_check_pidfile $riemann_pidfile) >+ >+ if [ -z "$rc_pid" ]; then >+ [ -n "$rc_fast" ] && return 0 >+ echo "${name} not running? (check $riemann_pidfile)." >+ return 1 >+ fi >+ echo "${name} is running as pid ${rc_pid}." >+} >+ >+riemann_check_pidfile() >+{ >+ _pidfile=$1 >+ if [ -z "$_pidfile" ]; then >+ err 3 'USAGE: riemann_check_pidfile pidfile' >+ fi >+ if [ ! -f $_pidfile ]; then >+ debug "pid file ($_pidfile): not readable." >+ return >+ fi >+ read _pid _junk < $_pidfile >+ if [ -z "$_pid" ]; then >+ debug "pid file ($_pidfile): no pid in file." >+ return >+ fi >+ if [ -n "`/usr/local/bin/jps -l | grep -e "^$_pid"`" ]; then >+ echo -n $_pid >+ fi >+} >+ >+riemann_stop() >+{ >+ rc_pid=$(riemann_check_pidfile $riemann_pidfile) >+ >+ if [ -z "$rc_pid" ]; then >+ [ -n "$rc_fast" ] && return 0 >+ echo "${name} not running? (check $riemann_pidfile)." >+ return 1 >+ fi >+ >+ echo "Stopping ${name}." >+ kill ${rc_pid} 2> /dev/null >+} >+ >+ >+ >+ > run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204988
:
163804
|
163807
|
165624
|
165625