Skip to content

Instantly share code, notes, and snippets.

@jeffgeiger
Forked from nodesocket/kibana
Last active December 21, 2015 22:58
Show Gist options
  • Save jeffgeiger/6378597 to your computer and use it in GitHub Desktop.
Save jeffgeiger/6378597 to your computer and use it in GitHub Desktop.
Modified to use RVM.
#!/bin/bash
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Make sense of a mountain of logs.
### END INIT INFO
#
# chkconfig: 2345 20 80
#
KIBANA_PATH="/kibana"
source /etc/profile.d/rvm.sh
RUBY=$(which ruby)
case "$1" in
start)
$RUBY $KIBANA_PATH/kibana-daemon.rb $1
RETVAL=$?
;;
stop)
$RUBY $KIBANA_PATH/kibana-daemon.rb $1
RETVAL=$?
;;
restart)
$RUBY $KIBANA_PATH/kibana-daemon.rb $1
RETVAL=$?
;;
status)
$RUBY $KIBANA_PATH/kibana-daemon.rb $1
;;
force-reload)
$RUBY $KIBANA_PATH/kibana-daemon.rb zap
$RUBY $KIBANA_PATH/kibana-daemon.rb start
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|status|force-reload}"
exit 1
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment