summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/ganeti/files/ganeti.initd')
-rw-r--r--app-emulation/ganeti/files/ganeti.initd57
1 files changed, 57 insertions, 0 deletions
diff --git a/app-emulation/ganeti/files/ganeti.initd b/app-emulation/ganeti/files/ganeti.initd
new file mode 100644
index 000000000000..8d31f1698490
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti.initd
@@ -0,0 +1,57 @@
+#!/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
+}