-
-
Save sebastianhoitz/5487474 to your computer and use it in GitHub Desktop.
This version works with the current graylog 0.10 graylog2ctl script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: Graylog2 | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts Graylog2 | |
# Description: Starts Graylog2 using start-stop-daemon | |
### END INIT INFO | |
GL_HOME=/opt/graylog2-server | |
NAME=graylog2 | |
DESC=graylog2 | |
set -e | |
cd $GL_HOME | |
case "$1" in | |
start) | |
echo -n "Starting $DESC... " | |
./bin/graylog2ctl start | |
;; | |
stop) | |
echo -n "Stopping $DESC ($PID)..." | |
./bin/graylog2ctl stop | |
echo stopped. | |
;; | |
status) | |
./bin/graylog2ctl status | |
;; | |
restart|force-reload) | |
${0} stop | |
sleep 0.5 | |
${0} start | |
;; | |
*) | |
N=/etc/init.d/$NAME | |
echo "Usage: $N {start|stop|restart|force-reload}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment