comparison Kibana.rc @ 27:76544ad0561d

switch kibana to ruby gem rather than jruby
author Carl Byington <carl@five-ten-sg.com>
date Mon, 06 May 2013 23:31:24 -0700
parents 610835fb4209
children
comparison
equal deleted inserted replaced
26:610835fb4209 27:76544ad0561d
20 ### END INIT INFO 20 ### END INIT INFO
21 21
22 . /etc/sysconfig/Kibana 22 . /etc/sysconfig/Kibana
23 23
24 DESC="Kibana Daemon" 24 DESC="Kibana Daemon"
25 JAVA=$(which java 2>/dev/null)
26 if [ "$(which jruby 2>/dev/null)" == '' ]; then
27 JRUBY_CMD="$JAVA $JAVAARGS -jar /usr/share/jruby.jar"
28 else
29 JRUBY_CMD="jruby"
30 fi
31 LOGFILE=/var/log/Kibana/Kibana.log 25 LOGFILE=/var/log/Kibana/Kibana.log
32 PIDFILE=/var/run/Kibana.pid 26 PIDFILE=/var/run/Kibana.pid
33 base=Kibana 27 base=Kibana
34 28
35 . /etc/init.d/functions 29 . /etc/init.d/functions
36 30
37 # 31 #
38 # Function that starts the daemon/service 32 # Function that starts the daemon/service
39 # 33 #
40 do_start() { 34 do_start() {
41 cd /usr/share/java/Kibana 35 cd /home/kibana
42 pid=$( 36 pid=$(
43 exec sudo -u kibana /bin/bash - <<EOF 37 exec sudo -u kibana /bin/bash - <<EOF
44 export GEM_HOME=$(pwd)
45 export GEM_PATH=
46 export JAVA_MEM=$JAVA_MEM
47 export JAVA_STACK=$JAVA_STACK
48 export KIBANA_HOST=$KIBANA_HOST 38 export KIBANA_HOST=$KIBANA_HOST
49 export KIBANA_PORT=$KIBANA_PORT 39 export KIBANA_PORT=$KIBANA_PORT
50 export KIBANA_ES=$KIBANA_ES 40 export KIBANA_ES=$KIBANA_ES
51 $JRUBY_CMD kibana.rb >>$LOGFILE 2>&1 & 41 export KIBANA_CONFIG=$KIBANA_CONFIG
42 kibana >>$LOGFILE 2>&1 &
52 echo \$! 43 echo \$!
53 EOF 44 EOF
54 ) 45 )
55 echo $pid >$PIDFILE 46 echo $pid >$PIDFILE
56 [ -n "$pid" ] && success $"$base startup" || failure $"$base startup" 47 [ -n "$pid" ] && success $"$base startup" || failure $"$base startup"