-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkimchid
More file actions
executable file
·53 lines (47 loc) · 888 Bytes
/
kimchid
File metadata and controls
executable file
·53 lines (47 loc) · 888 Bytes
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
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: kimchid
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/Stop HTML5 based management tool for KVM.
### END INIT INFO
NAME=kimchid
KIMCHIPATH="/usr/bin/"
KIMCHIBIN="$KIMCHIPATH/$NAME"
PIDFILE="/var/run/kimchid.pid"
BIND_IP="0.0.0.0"
KIMCHILOG=/dev/null
start() {
[ -f $PIDFILE ] && exit 1;
$KIMCHIBIN --host=$BIND_IP >> $KIMCHILOG 2>&1 &
echo $! > $PIDFILE
}
stop() {
kill -9 $(cat $PIDFILE)
rm $PIDFILE
}
restart() {
stop
sleep 0.5
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
exit 0