blob: 8d31f1698490c8053cd72d6a81ad6a4e7f7be28a [file] [log] [blame]
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
depend() {
need localmount xend drbd
before ganeti-kvm-poweroff
after bootmisc nfsmount
}
checkconfig() {
for fname in /var/lib/ganeti/ssconf_node_pass /var/lib/ganeti/server.pem
do
if [[ ! -f "$fname" ]]
then
eerror "Config file $fname not found, will not run."
return 1
fi
done
return 0
}
start() {
checkconfig || return 1
ebegin "Starting ganeti-master"
/usr/sbin/ganeti-master start
ret=$?
eend ${ret}
[[ "${ret}" != 0 ]] && return 1
ebegin "Starting ganeti-noded"
start-stop-daemon --start --quiet --exec /usr/sbin/ganeti-noded
ret=$?
eend ${ret}
[[ "${ret}" != 0 ]] && return 1
return 0
}
stop() {
ebegin "Stopping ganeti-noded"
start-stop-daemon --stop --quiet --name ganeti-noded
ret=$?
eend ${ret}
[[ "${ret}" != 0 ]] && return 1
ebegin "Stopping ganeti-master"
/usr/sbin/ganeti-master start
ret=$?
eend ${ret}
[[ "${ret}" != 0 ]] && return 1
return 0
}