This commit is contained in:
committed by
Git OBS Bridge
parent
241ee9df04
commit
d7002a96b9
29
init.xend
29
init.xend
@@ -48,6 +48,23 @@ cleanup()
|
||||
rm -f /var/lib/xen/xenbl* 2>/dev/null
|
||||
}
|
||||
|
||||
parseln()
|
||||
{
|
||||
name=${1:0:$((${#1}-36))}
|
||||
name=${name%% *}
|
||||
rest="${1: -36}"
|
||||
id=${rest:0:4}
|
||||
id=`echo $id`
|
||||
mem=${rest:4:6}
|
||||
mem=`echo $mem`
|
||||
vcpu=${rest:10:6}
|
||||
vcpu=`echo $vcpu`
|
||||
state=${rest:16:11}
|
||||
state=`echo $state`
|
||||
tm=${rest:27}
|
||||
tm=`echo $tm`
|
||||
}
|
||||
|
||||
if [ "$1" == status ]; then
|
||||
if [ ! -e /proc/xen/capabilities ]; then
|
||||
xend_abort 3
|
||||
@@ -70,7 +87,6 @@ fi
|
||||
XEND=`ps ax | grep xend | grep python | awk '{ print $1 }'`
|
||||
XEND=`echo $XEND`
|
||||
|
||||
#export PYTHONOPTIMIZE=2
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting xend "
|
||||
@@ -101,14 +117,16 @@ case "$1" in
|
||||
else
|
||||
echo -n "(pid $XEND) "
|
||||
unset sysrq_sent
|
||||
while read nm id mem vcpu state time; do
|
||||
if [ $id = 0 ]; then continue; fi
|
||||
while read LN; do
|
||||
parseln "$LN"
|
||||
[ -z "$id" ] && continue
|
||||
[ "$id" = 0 ] && continue
|
||||
sysrq_sent=1
|
||||
echo -en "\n Warning: Domain $nm (ID $id) still up ($state)"
|
||||
echo -en "\n Warning: Domain $name (ID $id) still up ($state)"
|
||||
# Domains should be closed down by xendomains; anyway, send
|
||||
# SysRq-S to avoid the worst in case domains are not shut down.
|
||||
xm sysrq $id s
|
||||
done < <(xm list | grep -v ^Name)
|
||||
done < <(xm list | grep -v '^Name *ID')
|
||||
if [ -n "$sysrq_sent" ]; then sleep 1; fi
|
||||
xend stop
|
||||
cleanup
|
||||
@@ -146,6 +164,5 @@ case "$1" in
|
||||
rc_exit
|
||||
esac
|
||||
|
||||
#unset PYTHONOPTIMIZE
|
||||
rc_status -v
|
||||
rc_exit
|
||||
|
Reference in New Issue
Block a user