Skip to content

Instantly share code, notes, and snippets.

@mblankleder
Last active August 29, 2015 14:09
Show Gist options
  • Save mblankleder/620601a035cb84a8c78b to your computer and use it in GitHub Desktop.
Save mblankleder/620601a035cb84a8c78b to your computer and use it in GitHub Desktop.
Kibana 4 init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: kibana
# Description: Minimal start script for kibana 4
### END INIT INFO
NAME="kibana"
KIBANA_HOME=/usr/local
PID=`ps -ef |grep kibana.jar|grep -v grep |awk '{print $2}'`
case "$1" in
start)
echo "Starting $NAME"
if [ -z "$PID" ]; then
$KIBANA_HOME/$NAME/bin/$NAME > /var/log/$NAME.log 2>&1 &
fi
;;
stop)
echo "Stopping $NAME"
if [ ! -z "$PID" ]; then
kill $PID
else
echo "$NAME not running"
fi
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment