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
17 DAEMON_UTIL=@PKGLIBDIR@/daemon-util
19 SCRIPTNAME="@SYSCONFDIR@/init.d/ganeti"
21 test -f "$DAEMON_UTIL" || exit 0
23 . /lib/lsb/init-functions
28 if errmsg=$($DAEMON_UTIL check-exitcode $RC)
30 log_action_end_msg 0 "$errmsg"
32 log_action_end_msg 1 "$errmsg"
37 # called as start_action daemon-name
39 log_action_begin_msg "$daemon"
40 $DAEMON_UTIL start "$@"
45 # called as stop_action daemon-name
47 log_action_begin_msg "$daemon"
48 $DAEMON_UTIL stop "$@"
56 if [ -z "$requested" -o "$requested" = "$target" ]; then
62 if ! $DAEMON_UTIL check-config; then
63 log_warning_msg "Incomplete configuration, will not run."
67 for i in $($DAEMON_UTIL list-start-daemons); do
68 maybe_do "$1" start_action $i
73 for i in $($DAEMON_UTIL list-stop-daemons); do
74 maybe_do "$1" stop_action $i
78 if [ -n "$2" ] && ! errmsg=$($DAEMON_UTIL is-daemon-name "$2" 2>&1); then
79 log_failure_msg "$errmsg"
85 log_daemon_msg "Starting $DESC" "$2"
89 log_daemon_msg "Stopping $DESC" "$2"
93 log_daemon_msg "Restarting $DESC" "$2"
98 log_success_msg "Usage: $SCRIPTNAME {start|stop|force-reload|restart}"