#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-emulation/ganeti/files/ganeti.initd,v 1.1 2007/11/23 12:45:00 hansmi Exp $ depend() { need localmount xend drbd after bootmisc } 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 }