Sha256: 50af3b958221191b53a32e63e1244b14124d0aed1347b009db6f624fbddc429a

Contents?: true

Size: 1.54 KB

Versions: 25

Compression:

Stored size: 1.54 KB

Contents

#!/bin/sh
#
# chkconfig: - 70 45
# description: The LogStash collection agent
# processname: logstash-agent
# config: /etc/sysconfig/logstash

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

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

# Defaults. Override in /etc/sysconfig/logstash-agent
OPTIONS=""
DEBUG=false
DIR=/opt/logstash
CONFIG=$DIR/etc/logstash-agent.yaml
LOGFILE=/var/log/logstash-agent.log

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

RETVAL=0
prog="logstash-agent"

start () {
	echo -n $"Starting $prog: "

	if $DEBUG; then
		OPTIONS="$OPTIONS -d"
	fi
        OPTIONS="$OPTIONS --pidfile /var/run/logstash-agent.pid"
        OPTIONS="$OPTIONS --logfile $LOGFILE"
        OPTIONS="$OPTIONS $CONFIG"

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

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

restart () {
        stop
        start
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	status -p /var/run/logstash-agent.pid logstash-agent
	;;
  restart|reload|force-reload)
	restart
	;;
  condrestart)
	[ -f /var/lock/subsys/logstash-agent ] && 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-agent
logstash-lite-0.2.20110422152244 etc/redhat/logstash-agent
logstash-lite-0.2.20110405105201 etc/redhat/logstash-agent
logstash-lite-0.2.20110331121236 etc/redhat/logstash-agent
logstash-lite-0.2.20110329105411 etc/redhat/logstash-agent
logstash-lite-0.2.20110206003603 etc/redhat/logstash-agent
logstash-lite-0.2.20110203130400 etc/redhat/logstash-agent
logstash-lite-0.2.20110122143801 etc/redhat/logstash-agent
logstash-lite-0.2.20110112115019 etc/redhat/logstash-agent
logstash-lite-0.2.20101222161646 etc/redhat/logstash-agent
logstash-lite-0.2.20101208111718 etc/redhat/logstash-agent
logstash-lite-0.2.20101207114354 etc/redhat/logstash-agent
logstash-lite-0.2.20101201111523 etc/redhat/logstash-agent
logstash-lite-0.2.20101129210156 etc/redhat/logstash-agent
logstash-lite-0.2.20101129205551 etc/redhat/logstash-agent
logstash-lite-0.2.20101129155412 etc/redhat/logstash-agent
logstash-lite-0.2.20101124030048 etc/redhat/logstash-agent
logstash-lite-0.2.20101124004656 etc/redhat/logstash-agent
logstash-lite-0.2.20101123134625 etc/redhat/logstash-agent
logstash-lite-0.2.20101123133737 etc/redhat/logstash-agent