Sha256: d5ae94bbab6f48bac6df1736b65aa32655e50d5ce2187a5620edd5956d2924aa

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

#! /bin/sh
#
# Logstash Start/Stop logstash
#
# chkconfig: 345 99 99
# description: Logstash
# processname: logstash

logstash_bin="/usr/bin/logstash"
logstash_conf="/etc/logstash/logstash.yaml"
logstash_log="/var/log/logstash/logstash.log"
NICE_LEVEL="-n 19"

find_logstash_process () {
    PIDTEMP=`ps ux | grep ruby | grep logstash | awk '{ print $2 }'`
    # Pid not found
    if [ "x$PIDTEMP" = "x" ]; then
        PID=-1
    else
        PID=$PIDTEMP
    fi
}

start () {
    LOG_DIR=`dirname ${logstash_log}`
    if [ ! -d $LOG_DIR ]; then
      echo "Log dir ${LOG_DIR} doesn't exist. Creating"
      mkdir $LOG_DIR
    fi
    nice ${NICE_LEVEL} ${logstash_bin} -d -f ${logstash_conf} -l ${logstash_log}
}

stop () {
    find_logstash_process
    if [ $PID -ne -1 ]; then
        kill $PID
    fi
}

case $1 in
start)
        start
        ;;
stop)
        stop
        exit 0
        ;;
reload)
        stop
        start
        ;;
restart)
        stop
        start
        ;;
status)
        find_logstash_process
	if [ $PID -gt 0 ]; then
            exit 0
        else
            exit 1
	fi 
        ;;
*)
        echo $"Usage: $0 {start|stop|restart|reload|status}"
        RETVAL=1
esac
exit 0

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
logstash-lite-0.2.20110505142231 etc/init/logstash
logstash-lite-0.2.20110422152244 etc/init/logstash
logstash-lite-0.2.20110405105201 etc/init/logstash
logstash-lite-0.2.20110331121236 etc/init/logstash
logstash-lite-0.2.20110329105411 etc/init/logstash
logstash-lite-0.2.20110206003603 etc/init/logstash
logstash-lite-0.2.20110203130400 etc/init/logstash
logstash-lite-0.2.20110122143801 etc/init/logstash
logstash-lite-0.2.20110112115019 etc/init/logstash
logstash-lite-0.2.20101222161646 etc/init/logstash