Mercurial > logstash
comparison logstash.rc @ 18:2b887e35b5cd
work on building from source
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 15 Apr 2013 19:33:28 -0700 |
parents | aa606d801e02 |
children | 729f36e68da8 |
comparison
equal
deleted
inserted
replaced
17:292b6583148a | 18:2b887e35b5cd |
---|---|
29 DESC="Logstash Daemon" | 29 DESC="Logstash Daemon" |
30 JAVA=$(which java) | 30 JAVA=$(which java) |
31 CONFIGFILE=/etc/logstash/logstash.conf | 31 CONFIGFILE=/etc/logstash/logstash.conf |
32 LOGFILE=/var/log/logstash/logstash.log | 32 LOGFILE=/var/log/logstash/logstash.log |
33 JARNAME=/usr/local/bin/logstash.jar | 33 JARNAME=/usr/local/bin/logstash.jar |
34 ARGS="-jar $JARNAME agent --config $CONFIGFILE --log $LOGFILE $AGENTARGS -- web $WEBARGS" | 34 ARGS="$JAVAARGS -jar $JARNAME agent --config $CONFIGFILE --log $LOGFILE $AGENTARGS -- web $WEBARGS" |
35 PIDFILE=/var/run/logstash.pid | 35 PIDFILE=/var/run/logstash.pid |
36 base=logstash | 36 base=logstash |
37 | 37 |
38 # Exit if java is not installed | 38 # Exit if java is not installed |
39 if [ ! -x "$JAVA" ]; then | 39 if [ ! -x "$JAVA" ]; then |
48 # | 48 # |
49 do_start() { | 49 do_start() { |
50 cd $HOME | 50 cd $HOME |
51 pid=$( | 51 pid=$( |
52 exec sudo -u logstash /bin/bash - <<EOF | 52 exec sudo -u logstash /bin/bash - <<EOF |
53 $JAVA $ARGS & | 53 $JAVA $ARGS & |
54 echo \$! | 54 echo \$! |
55 EOF | 55 EOF |
56 ) | 56 ) |
57 echo $pid >$PIDFILE | 57 echo $pid >$PIDFILE |
58 [ -n "$pid" ] && success $"$base startup" || failure $"$base startup" | 58 [ -n "$pid" ] && success $"$base startup" || failure $"$base startup" |