forked from whamcloud/integrated-manager-for-lustre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchroma-host-discover-init.sh
64 lines (55 loc) · 1.41 KB
/
chroma-host-discover-init.sh
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
#!/bin/bash
#
# chroma-host-discover Chroma host discovery service
#
# chkconfig: 345 88 12
# description: starts the chroma host discovery daemon
# processname: python
# Source function library.
. /etc/init.d/functions
export SERVICE_NAME=chroma-host-discover
export PROJECT_PATH=/usr/share/chroma-manager
export PYTHONPATH=${PROJECT_PATH}
start() {
echo -n "Starting the chroma host discovery daemon: "
# we don't need --pidfile here since chroma-host-discover is a daemon
# and takes care of creating the pid file
daemon /usr/bin/chroma-host-discover
echo
}
restart() {
echo -n "Restarting the chroma host discovery daemon: "
kill $(cat /var/run/chroma-host-discover.pid)
# we don't need --pidfile here since chroma-host-discover is a daemon
# and takes care of creating the pid file
daemon /usr/bin/chroma-host-discover
echo
}
stop() {
echo -n "Stopping chroma-host-discover: "
kill $(cat /var/run/chroma-host-discover.pid)
echo
}
case "$1" in
start)
start "$2"
exit $?
;;
stop)
stop
exit $?
;;
status)
# FIXME: check that ALL the pids are running
status -p /var/run/chroma-host-discover.pid ${SERVICE_NAME}
exit $?
;;
restart|force-reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0