2 # ganeti node daemon starter script
3 # based on skeleton from Debian GNU/Linux
6 # Required-Start: $syslog $remote_fs
7 # Required-Stop: $syslog $remote_fs
8 # Default-Start: 2 3 4 5
10 # Short-Description: Ganeti Cluster Manager
11 # Description: Ganeti Cluster Manager
14 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
18 MASTERD="ganeti-masterd"
22 DAEMON_UTIL=@PKGLIBDIR@/daemon-util
24 SCRIPTNAME="@SYSCONFDIR@/init.d/ganeti"
26 test -f "@PREFIX@/sbin/$NODED" || exit 0
28 . /lib/lsb/init-functions
37 log_action_end_msg 0 "not master"
40 log_action_end_msg 1 "exit code $RC"
46 # called as start_action daemon-name
48 log_action_begin_msg "$daemon"
49 $DAEMON_UTIL start "$@"
54 # called as stop_action daemon-name
56 log_action_begin_msg "$daemon"
57 $DAEMON_UTIL stop "$@"
65 if [ -z "$requested" -o "$requested" = "$target" ]; then
71 if ! $DAEMON_UTIL check-config; then
72 log_warning_msg "Incomplete configuration, will not run."
76 for i in $NODED $MASTERD $CONFD $RAPI; do \
77 maybe_do "$1" start_action $i
82 for i in $RAPI $CONFD $MASTERD $NODED; do \
83 maybe_do "$1" stop_action $i
90 "$2" != "$MASTERD" -a \
91 "$2" != "$RAPI" ]; then
92 log_failure_msg "Unknown daemon '$2' requested"
98 log_daemon_msg "Starting $DESC" "$2"
102 log_daemon_msg "Stopping $DESC" "$2"
105 restart|force-reload)
106 log_daemon_msg "Restarting $DESC" "$2"
111 log_success_msg "Usage: $SCRIPTNAME {start|stop|force-reload|restart}"