You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-emulation/ganeti/files/ganeti.initd

58 lines
1.0 KiB

#!/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
}