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.

Revisions

  1. Michel Blankleder revised this gist Nov 18, 2014. 1 changed file with 11 additions and 9 deletions.
    20 changes: 11 additions & 9 deletions kibana
    Original file line number Diff line number Diff line change
    @@ -12,25 +12,27 @@

    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"
    ps -ef |grep kibana.jar|grep -v grep |awk '{print $2}'|xargs kill
    ;;
    restart)
    stop
    sleep 2
    start
    ;;
    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
    exit 0
  2. Michel Blankleder created this gist Nov 17, 2014.
    36 changes: 36 additions & 0 deletions kibana
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    #!/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

    case "$1" in
    start)
    echo "Starting $NAME"
    $KIBANA_HOME/$NAME/bin/$NAME > /var/log/$NAME.log 2>&1 &
    ;;
    stop)
    echo "Stopping $NAME"
    ps -ef |grep kibana.jar|grep -v grep |awk '{print $2}'|xargs kill
    ;;
    restart)
    stop
    sleep 2
    start
    ;;
    *)
    echo "Usage: /etc/init.d/$NAME {start|stop}"
    exit 1
    ;;
    esac

    exit 0