comparison logstash.rc @ 11:4899fb1b3eb3

add sysconfig snippet to avoid modifying non-config files
author Carl Byington <carl@five-ten-sg.com>
date Fri, 22 Mar 2013 13:45:38 -0700
parents e4ba03940224
children c158cae7cd26
comparison
equal deleted inserted replaced
10:fa645feb1f0e 11:4899fb1b3eb3
21 ### END INIT INFO 21 ### END INIT INFO
22 22
23 # Amount of memory for Java 23 # Amount of memory for Java
24 #JAVAMEM=256M 24 #JAVAMEM=256M
25 25
26 . /etc/sysconfig/logstash
27
26 export HOME=/var/lib/logstash 28 export HOME=/var/lib/logstash
27 DESC="Logstash Daemon" 29 DESC="Logstash Daemon"
28 JAVA=$(which java) 30 JAVA=$(which java)
29 CONFIGFILE=/etc/logstash/logstash.conf 31 CONFIGFILE=/etc/logstash/logstash.conf
30 LOGFILE=/var/log/logstash/logstash.log 32 LOGFILE=/var/log/logstash/logstash.log
31 JARNAME=/usr/local/bin/logstash.jar 33 JARNAME=/usr/local/bin/logstash.jar
32 ARGS="-jar ${JARNAME} agent --config ${CONFIGFILE} --log ${LOGFILE} -- web --backend elasticsearch://127.0.0.1/?local" 34 ARGS="-jar $JARNAME agent --config $CONFIGFILE --log $LOGFILE $AGENTARGS -- web $WEBARGS"
33 SCRIPTNAME=/etc/rc.d/init.d/logstash
34 PIDFILE=/var/run/logstash.pid 35 PIDFILE=/var/run/logstash.pid
35 base=logstash 36 base=logstash
36 37
37 # Exit if java is not installed 38 # Exit if java is not installed
38 if [ ! -x "$JAVA" ]; then 39 if [ ! -x "$JAVA" ]; then
39 echo "Couldn't find $JAVA" 40 echo "Couldn't find java"
40 exit 99 41 exit 99
41 fi 42 fi
42 43
43 . /etc/init.d/functions 44 . /etc/init.d/functions
44 45
91 status) 92 status)
92 echo -n "$base " 93 echo -n "$base "
93 status -p $PIDFILE 94 status -p $PIDFILE
94 ;; 95 ;;
95 *) 96 *)
96 echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2 97 echo "Usage: service $base {start|stop|status|restart}" >&2
97 exit 3 98 exit 3
98 ;; 99 ;;
99 esac 100 esac
100 101
101 echo 102 echo