This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathkibana.init.debian
executable file
·89 lines (75 loc) · 1.72 KB
/
kibana.init.debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
#
# /etc/init.d/kibana -- startup script for Kibana.
#
#
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts kibana
# Description: Starts kibana using start-stop-daemon
### END INIT INFO
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=kibana
DESC="Kibana frontend"
DEFAULT=/etc/default/$NAME
if [ `id -u` -ne 0 ]; then
echo "You need root privileges to run this script"
exit 1
fi
. /lib/lsb/init-functions
if [ -r /etc/default/rcS ]; then
. /etc/default/rcS
fi
# The following variables can be overwritten in $DEFAULT
PID_DIR=/var/run
# End of variables that can be overwritten in $DEFAULT
# overwrite settings from default file
if [ -f "$DEFAULT" ]; then
. "$DEFAULT"
fi
# Define other required variables
KIBANA_HOME=/usr/local/kibana
export PID_DIR=$PID_DIR
export GEM_PATH="$KIBANA_HOME/vendor/bundle/ruby/1.*"
DAEMON_OPTS="$KIBANA_HOME/kibana-daemon.rb"
DAEMON="/usr/bin/env ruby"
CONFIG="$KIBANA_HOME/KibanaConfig.rb"
PID_FILE=$PID_DIR/kibana.rb.pid
case "$1" in
start)
log_daemon_msg "Starting $DESC"
# Start Daemon
$DAEMON $DAEMON_OPTS start
if [[ $? -eq 0 ]]; then
log_end_msg 0
fi
;;
stop)
log_daemon_msg "Stopping $DESC"
# Stop Daemon
if [ -f "$PID_FILE" ]; then
$DAEMON $DAEMON_OPTS stop
log_end_msg 0
fi
;;
status)
$DAEMON $DAEMON_OPTS status
;;
restart|force-reload)
if [ -f "$PID_FILE" ]; then
$0 stop
sleep 1
fi
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0