2 # ganeti node daemon starter script
3 # based on skeleton from Debian GNU/Linux
6 # Required-Start: $syslog $remote_fs xend
7 # Required-Stop: $syslog $remote_fs xend
8 # Default-Start: 2 3 4 5
10 # Short-Description: Ganeti Xen Cluster Manager
11 # Description: Ganeti Xen Cluster Manager
14 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
17 GANETIRUNDIR="@LOCALSTATEDIR@/run/ganeti"
19 NODED_NAME="ganeti-noded"
20 NODED="@PREFIX@/sbin/${NODED_NAME}"
21 NODED_PID="${GANETIRUNDIR}/${NODED_NAME}.pid"
23 MASTERD_NAME="ganeti-masterd"
24 MASTERD="@PREFIX@/sbin/${MASTERD_NAME}"
25 MASTERD_PID="${GANETIRUNDIR}/${MASTERD_NAME}.pid"
27 RAPI_NAME="ganeti-rapi"
28 RAPI="@PREFIX@/sbin/${RAPI_NAME}"
29 RAPI_PID="${GANETIRUNDIR}/${RAPI_NAME}.pid"
31 SCRIPTNAME="@SYSCONFDIR@/init.d/ganeti"
33 test -f $NODED || exit 0
35 . /lib/lsb/init-functions
39 "@LOCALSTATEDIR@/lib/ganeti/server.pem"
41 if ! [ -f "$fname" ]; then
43 log_warning_msg "Config $fname not there, will not run."
56 log_action_end_msg 0 "not master"
59 log_action_end_msg 1 "exit code $RC"
65 # called as start_action daemon pidfile
66 log_action_begin_msg "$1"
67 start-stop-daemon --start --quiet --exec "$1" --pidfile "$2"
72 # called as stop_action daemon pidfile
73 log_action_begin_msg "$1"
74 start-stop-daemon --stop --quiet --oknodo \
75 --retry 30 --pidfile "$2"
82 log_daemon_msg "Starting $DESC" "$NAME"
84 start_action $NODED $NODED_PID
85 start_action $MASTERD $MASTERD_PID
86 start_action $RAPI $RAPI_PID
89 log_daemon_msg "Stopping $DESC" "$NAME"
90 stop_action $RAPI $RAPI_PID
91 stop_action $MASTERD $MASTERD_PID
92 stop_action $NODED $NODED_PID
95 log_daemon_msg "Reloading $DESC"
96 stop_action $RAPI $RAPI_PID
97 stop_action $MASTERD $MASTERD_PID
98 stop_action $NODED $NODED_PID
100 start_action $NODED $NODED_PID
101 start_action $MASTERD $MASTERD_PID
102 start_action $RAPI $RAPI_PID
105 log_success_msg "Usage: $SCRIPTNAME {start|stop|force-reload|restart}"