version bump for ganeti-2.4.3
This commit is contained in:
97
app-emulation/ganeti/files/ganeti-2.1.initd
Normal file
97
app-emulation/ganeti/files/ganeti-2.1.initd
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/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-2.1.initd,v 1.3 2010/03/07 20:56:02 ramereth Exp $
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
NODED="ganeti-noded"
|
||||
MASTERD="ganeti-masterd"
|
||||
CONFD="ganeti-confd"
|
||||
RAPI="ganeti-rapi"
|
||||
DAEMON_UTIL="/usr/lib/ganeti/daemon-util"
|
||||
|
||||
check_config() {
|
||||
for fname in /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
|
||||
}
|
||||
|
||||
check_exitcode() {
|
||||
RC=${1}
|
||||
case ${RC} in
|
||||
0)
|
||||
eend 0
|
||||
;;
|
||||
11)
|
||||
eend 0 "not master"
|
||||
;;
|
||||
*)
|
||||
eend 1 "exit code $RC"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
start_action() {
|
||||
# called as start_action daemon-name
|
||||
local daemon="${1}"
|
||||
ebegin "Starting ${daemon}"
|
||||
${DAEMON_UTIL} start "${@}"
|
||||
check_exitcode ${?}
|
||||
}
|
||||
|
||||
stop_action() {
|
||||
# called as stop_action daemon-name
|
||||
local daemon="${1}"
|
||||
ebegin "Stopping ${daemon}"
|
||||
${DAEMON_UTIL} stop "${@}"
|
||||
check_exitcode ${?}
|
||||
}
|
||||
|
||||
maybe_do() {
|
||||
requested="${1}"; shift
|
||||
action="${1}"; shift
|
||||
target="${1}"
|
||||
if [ -z "${requested}" -o "${requested}" = "${target}" ] ; then
|
||||
${action} "${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
start_all() {
|
||||
check_config
|
||||
for i in ${NODED} ${MASTERD} ${CONFD} ${RAPI}; do \
|
||||
case "${i}" in
|
||||
ganeti-masterd)
|
||||
GANETI_OPTS="${GANETI_OPTS} ${GANETI_MASTERD_OPTS}"
|
||||
;;
|
||||
ganeti-rapid)
|
||||
GANETI_OPTS="${GANETI_OPTS} ${GANETI_RAPI_OPTS}"
|
||||
;;
|
||||
esac
|
||||
maybe_do "${1}" start_action ${i} ${GANETI_OPTS}
|
||||
done
|
||||
}
|
||||
|
||||
stop_all() {
|
||||
for i in ${RAPI} ${CONFD} ${MASTERD} ${NODED}; do \
|
||||
maybe_do "${1}" stop_action ${i}
|
||||
done
|
||||
}
|
||||
|
||||
start() {
|
||||
start_all
|
||||
}
|
||||
|
||||
stop() {
|
||||
stop_all
|
||||
}
|
||||
4
app-emulation/ganeti/files/ganeti-kvm-poweroff.confd
Normal file
4
app-emulation/ganeti/files/ganeti-kvm-poweroff.confd
Normal file
@@ -0,0 +1,4 @@
|
||||
# /etc/conf.d/ganeti-kvm-poweroff: config file for /etc/init.d/ganeti-kvm-poweroff
|
||||
|
||||
# Maximum time in seconds to wait until KVM VMs shutdown before giving up.
|
||||
# GANETI_KVM_TIMEOUT="60"
|
||||
58
app-emulation/ganeti/files/ganeti-kvm-poweroff.initd
Normal file
58
app-emulation/ganeti/files/ganeti-kvm-poweroff.initd
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/ganeti/files/ganeti-kvm-poweroff.initd,v 1.1 2011/01/22 02:07:43 ramereth Exp $
|
||||
|
||||
depend() {
|
||||
after ganeti
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
CONTROL_PATH="/var/run/ganeti/kvm-hypervisor/ctrl"
|
||||
GANETI_KVM_TIMEOUT=${GANETI_KVM_TIMEOUT:-60}
|
||||
|
||||
start() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Taken from doc/examples/ganeti-kvm-poweroff.initd.in in ganeti package
|
||||
stop() {
|
||||
ebegin "Stopping Ganeti KVM VMs"
|
||||
# shutdown VMs and remove sockets of those not running
|
||||
for vm_monitor in $(find $CONTROL_PATH -type s -name '*.monitor') ; do
|
||||
if ! echo system_powerdown | \
|
||||
socat -U UNIX:$vm_monitor STDIO > /dev/null 2>&1; then
|
||||
# remove disconnected socket
|
||||
rm -f $vm_monitor
|
||||
fi
|
||||
done
|
||||
|
||||
einfo " Waiting for VMs to poweroff"
|
||||
waiting=true
|
||||
remaining=$GANETI_KVM_TIMEOUT
|
||||
while $waiting && [ $remaining -ne 0 ]; do
|
||||
if [ -z "$(find $CONTROL_PATH -type s -name '*.monitor')" ] ; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo -n "."
|
||||
for vm_monitor in $(find $CONTROL_PATH -type s -name '*.monitor') ; do
|
||||
if ! echo | socat -U UNIX:$vm_monitor STDIO > /dev/null 2>&1; then
|
||||
rm -rf $vm_monitor
|
||||
fi
|
||||
done
|
||||
|
||||
sleep 5
|
||||
let remaining-=5 1
|
||||
done
|
||||
|
||||
if [ -n "$(find $CONTROL_PATH -type s -name '*.monitor')" ] ; then
|
||||
eerror " Some ganeti VMs did not shutdown"
|
||||
fi
|
||||
echo
|
||||
eend $?
|
||||
}
|
||||
|
||||
restart() {
|
||||
eerror "restart not supported"
|
||||
}
|
||||
10
app-emulation/ganeti/files/ganeti.confd
Normal file
10
app-emulation/ganeti/files/ganeti.confd
Normal file
@@ -0,0 +1,10 @@
|
||||
# /etc/conf.d/ganeti: config file for /etc/init.d/ganeti
|
||||
|
||||
# Extra options to pass to all of the ganeti daemons
|
||||
# GANETI_OPTS="-d"
|
||||
|
||||
# Options to pass to ganeti-masterd
|
||||
# GANETI_MASTERD_OPTS=""
|
||||
|
||||
# Options to pass to ganeti-rapi
|
||||
# GANETI_RAPI_OPTS=""
|
||||
57
app-emulation/ganeti/files/ganeti.initd
Normal file
57
app-emulation/ganeti/files/ganeti.initd
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2011 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.3 2011/03/29 22:12:25 ramereth Exp $
|
||||
|
||||
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
|
||||
}
|
||||
55
app-emulation/ganeti/files/ganeti2.initd
Normal file
55
app-emulation/ganeti/files/ganeti2.initd
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/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/ganeti2.initd,v 1.1 2009/10/02 22:12:19 ramereth Exp $
|
||||
|
||||
depend() {
|
||||
need localmount drbd
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
for fname in /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_action() {
|
||||
# called as start_action daemon pidfile
|
||||
local daemon="${1}"; shift
|
||||
local pidfile="${1}"; shift
|
||||
ebegin "Starting ${daemon}"
|
||||
start-stop-daemon --start --quiet --exec "${daemon}" --pidfile "${pidfile}" \
|
||||
-- "${@}"
|
||||
eend ${?}
|
||||
}
|
||||
|
||||
stop_action() {
|
||||
# called as stop_action daemon pidfile
|
||||
ebegin "Stopping ${1}"
|
||||
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile "${2}"
|
||||
eend ${?}
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
checkconfig || return 1
|
||||
start_action /usr/sbin/ganeti-noded /var/run/ganeti/ganeti-noded.pid
|
||||
start_action /usr/sbin/ganeti-masterd /var/run/ganeti/ganeti-masterd.pid
|
||||
start_action /usr/sbin/ganeti-rapi /var/run/ganeti/ganeti-rapi.pid
|
||||
return 0
|
||||
}
|
||||
|
||||
stop() {
|
||||
stop_action /usr/sbin/ganeti-rapi /var/run/ganeti/ganeti-rapi.pid
|
||||
stop_action /usr/sbin/ganeti-masterd /var/run/ganeti/ganeti-masterd.pid
|
||||
stop_action /usr/sbin/ganeti-noded /var/run/ganeti/ganeti-noded.pid
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user