Sha256: 3e5b046b5d77f3005d0829ad0f4de01e1d23a10575962124532cca8922189606

Contents?: true

Size: 1.74 KB

Versions: 25

Compression:

Stored size: 1.74 KB

Contents

#!/bin/sh
#
# chkconfig: - 70 45
# description: The LogStash daemon processes, indexes, and searches logs centrally
# processname: logstashd
# config: /etc/sysconfig/logstash

# Standard LSB functions
#. /lib/lsb/init-functions

# Source function library.
. /etc/init.d/functions

# Defaults. Override in /etc/sysconfig/logstash
USER=logstash
OPTIONS=""
INDEX=true
PARSERS=1
DEBUG=false
DIR=/opt/logstash
CONFIG=$DIR/etc/logstashd.yaml
LOGFILE=/var/logstash/logstashd.log

if [ -f /etc/sysconfig/logstash ]; then 
	. /etc/sysconfig/logstash
fi

RETVAL=0
prog="logstashd"

start () {
	echo -n $"Starting $prog: "
        mkdir -p /var/run/logstash
        chown $USER /var/run/logstash

	if $DEBUG; then
		OPTIONS="$OPTIONS -d"
	fi
	if ! $INDEX; then
		OPTIONS="$OPTIONS -I"
	fi
	OPTIONS="$OPTIONS -p $PARSERS"
        OPTIONS="$OPTIONS --pidfile /var/run/logstash/logstashd.pid"
        OPTIONS="$OPTIONS --logfile $LOGFILE"
        OPTIONS="$OPTIONS $CONFIG"

	daemon --user $USER --pidfile /var/run/logstash/logstashd.pid \
	       $DIR/bin/logstashd $OPTIONS
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/logstashd
}

stop () {
	echo -n $"Stopping $prog: "
	killproc -p /var/run/logstash/logstashd.pid $DIR/bin/logstashd
	RETVAL=$?
	echo
	if [ $RETVAL -eq 0 ] ; then
	    rm -f /var/lock/subsys/logstashd
	    rm -f /var/run/logstash/logstashd.pid
	fi
}

restart () {
        stop
        start
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	status -p /var/run/logstash/logstashd.pid logstashd
	;;
  restart|reload|force-reload)
	restart
	;;
  condrestart)
	[ -f /var/lock/subsys/logstashd ] && restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
	exit 1
esac

exit $?

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
logstash-lite-0.2.20110505142231 etc/redhat/logstash
logstash-lite-0.2.20110422152244 etc/redhat/logstash
logstash-lite-0.2.20110405105201 etc/redhat/logstash
logstash-lite-0.2.20110331121236 etc/redhat/logstash
logstash-lite-0.2.20110329105411 etc/redhat/logstash
logstash-lite-0.2.20110206003603 etc/redhat/logstash
logstash-lite-0.2.20110203130400 etc/redhat/logstash
logstash-lite-0.2.20110122143801 etc/redhat/logstash
logstash-lite-0.2.20110112115019 etc/redhat/logstash
logstash-lite-0.2.20101222161646 etc/redhat/logstash
logstash-lite-0.2.20101208111718 etc/redhat/logstash
logstash-lite-0.2.20101207114354 etc/redhat/logstash
logstash-lite-0.2.20101201111523 etc/redhat/logstash
logstash-lite-0.2.20101129210156 etc/redhat/logstash
logstash-lite-0.2.20101129205551 etc/redhat/logstash
logstash-lite-0.2.20101129155412 etc/redhat/logstash
logstash-lite-0.2.20101124030048 etc/redhat/logstash
logstash-lite-0.2.20101124004656 etc/redhat/logstash
logstash-lite-0.2.20101123134625 etc/redhat/logstash
logstash-lite-0.2.20101123133737 etc/redhat/logstash