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/ssconf_node_pass" \
40 "@LOCALSTATEDIR@/lib/ganeti/server.pem"
42 if ! [ -f "$fname" ]; then
44 log_warning_msg "Config $fname not there, will not run."
57 log_action_end_msg 0 "not master"
60 log_action_end_msg 1 "exit code $RC"
66 # called as start_action daemon pidfile
67 log_action_begin_msg "$1"
68 start-stop-daemon --start --quiet --exec "$1" --pidfile "$2"
73 # called as stop_action daemon pidfile
74 log_action_begin_msg "$1"
75 start-stop-daemon --stop --quiet --oknodo \
76 --retry 30 --pidfile "$2"
83 log_daemon_msg "Starting $DESC" "$NAME"
85 start_action $NODED $NODED_PID
86 start_action $MASTERD $MASTERD_PID
87 start_action $RAPI $RAPI_PID
90 log_daemon_msg "Stopping $DESC" "$NAME"
91 stop_action $RAPI $RAPI_PID
92 stop_action $MASTERD $MASTERD_PID
93 stop_action $NODED $NODED_PID
96 log_daemon_msg "Reloading $DESC"
97 stop_action $RAPI $RAPI_PID
98 stop_action $MASTERD $MASTERD_PID
99 stop_action $NODED $NODED_PID
101 start_action $NODED $NODED_PID
102 start_action $MASTERD $MASTERD_PID
103 start_action $RAPI $RAPI_PID
106 log_success_msg "Usage: $SCRIPTNAME {start|stop|force-reload|restart}"