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