Last active
August 29, 2015 14:09
-
-
Save mblankleder/620601a035cb84a8c78b to your computer and use it in GitHub Desktop.
Kibana 4 init 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: 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