Graylog2 Web Interface start script

Das folgende Script startet das web-interface von Graylog2. /etc/init.d/graylog2-web-interface:

#!/bin/bash
#

graylog2-web-interface: graylog2 web interface

#

chkconfig: - 98 02

description: Starts graylog2-web-interface using passenger-standalone. \

### BEGIN INIT INFO

Provides: graylog2-web-interface

Required-Start: $remote_fs $syslog $network

Required-Stop: $remote_fs $syslog $network

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: Start graylog2-web-interface at boot time

Description: Controls the graylog2-web-interface.

END INIT INFO

# config
APP_DIR=/opt/graylog2-web-interface/
ADDR=127.0.0.1
PORT=3000
LOG_FILE=/var/log/graylog2-web-interface.log
ENVIRONMENT=production
SU=/bin/su
. /lib/lsb/init-functions
case “$1” in
start)
echo “Starting graylog2-web-interface”
$SU -l –shell=/bin/bash -c “cd $APP_DIR && passenger start -a $ADDR -p $PORT -e $ENVIRONMENT >> $LOG_FILE” &
;;
stop)
echo “Stopping graylog2-web-interface”
cd $APP_DIR && passenger stop -p $PORT
;;
status)
cd $APP_DIR && passenger status -p $PORT
;;
*)
echo “Usage: $0 start|stop|status” >&2
exit 3
;;
esac
exit 0