Skip to content

Instantly share code, notes, and snippets.

@sebastianhoitz
Forked from marzocchi/etc-init.d-graylog2.sh
Last active December 16, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastianhoitz/5487474 to your computer and use it in GitHub Desktop.
Save sebastianhoitz/5487474 to your computer and use it in GitHub Desktop.
This version works with the current graylog 0.10 graylog2ctl script
#! /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