Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 389906 Details for
Bug 529972
app-emulation/xen-tools-4.2.* with init xendomains ver. -r2: multiple problems (lock dom0 shutdown, screen not attached, hanging vm shutdown)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
initrd proposed patch
xendomains.initd-r2_20141120.patch (text/plain), 5.12 KB, created by
Daniele Palumbo
on 2014-11-20 16:31:45 UTC
(
hide
)
Description:
initrd proposed patch
Filename:
MIME Type:
Creator:
Daniele Palumbo
Created:
2014-11-20 16:31:45 UTC
Size:
5.12 KB
patch
obsolete
>--- a/xen-tools/files/xendomains.initd-r2 2014-06-15 22:01:05.000000000 +0200 >+++ b/xen-tools/files/xendomains.initd-r2 2014-02-06 00:03:47.225637919 +0100 >@@ -11,7 +11,7 @@ > } > > get_domname() { >- local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1) >+ local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" 2>/dev/null | tail -n 1) > > if [ -z ${name_from_file} ] ; then > basename "${1}" >@@ -24,12 +24,30 @@ > /usr/sbin/xl list "${1}" >/dev/null 2>&1 > } > >+domains_running() { >+ if [[ "`jobs -l|wc -l`" -eq "0" ]] ; then >+ return 1 >+ else >+ return 0 >+ fi >+ >+} >+ > using_screen() { > [ "${SCREEN}" = "yes" -o "${SCREEN}" = "YES" ] > } > > set_screen_cmd() { >- screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r ${SCREEN_NAME:=xen} -X" >+ export SCREENDIR >+ screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r -S ${SCREEN_NAME:=xen} -X" >+} >+ >+exists_screen() { >+ export SCREENDIR >+ screen -c ${SCREENRC:-/dev/null} -S ${SCREEN_NAME:=xen} -q -ls -r >+ # <10 no sessions, 10 session, but attached, 11 1 session, 12 2 sessions, ... >+ running_sessions=$? >+ return $running_sessions > } > > start() { >@@ -37,22 +55,48 @@ > > einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}" > if using_screen ; then >- ebegin "Creating screen session to hold domain consoles" >- ( screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME} -t dom0 \ >- && sleep 5 \ >- && ${screen_cmd} zombie dr \ >- && logrotate -f /etc/xen/xen-consoles.logrotate \ >- && ${screen_cmd} logfile /var/log/xen-consoles/%t.log \ >- && ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \ >- && ${screen_cmd} log on \ >- && ${screen_cmd} deflog on ) >/dev/null >- if [ $? -ne 0 ] ; then >+ export SCREENDIR >+ einfo "Wiping old sessions" >+ screen -S ${SCREEN_NAME:=xen} -wipe >+ exists_screen >+ rsessions=$? >+ case $rsessions in >+ "8") # no screeen, create >+ ebegin "Creating screen session to hold domain consoles" >+ ( >+ screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME:=xen} -t dom0 \ >+ && sleep 5 \ >+ && ${screen_cmd} zombie dr \ >+ && logrotate -f /etc/xen/xen-consoles.logrotate \ >+ && ${screen_cmd} logfile /var/log/xen-consoles/%t.log \ >+ && ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \ >+ && ${screen_cmd} log on \ >+ && ${screen_cmd} deflog on ) 2>&1 >/tmp/debug #>/dev/null >+ if [ $? -ne 0 ] ; then >+ eend 1 >+ return 1 >+ else >+ eend >+ fi >+ ;; >+ "10") # screen, but attached. detach. >+ ebegin "Detaching the connected screen session" >+ screen -d -S ${SCREEN_NAME:=xen} >+ eend $? >+ ;; >+ "11") # one session free, do nothing >+ einfo "Already existing screen session, doing nothing" >+ ;; >+ *) # more than one session >+ let rsessions=$rsessions-10 >+ ebegin "$rsessions session running. Please check with screen -S xen -ls." > eend 1 > return 1 >- else >- eend >- fi >+ esac > fi >+ # debug >+ #eend 1 >+ #return 1 > # Create all domains with config files in AUTODIR. > for dom in $(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort); do > name=$(get_domname ${dom}) >@@ -76,8 +120,16 @@ > einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}" > # Stop all domains with config files in AUTODIR. > DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)" >- >- if [ "$PARALLEL_SHUTDOWN" = "yes" ] ; then >+ RDOMAINS="$(/usr/sbin/xl vm-list|awk '{print $3}'|grep -v "^name$")" >+ >+ # Adding running domains >+ for rdom in $RDOMAINS ; do >+ if [[ "`echo $DOMAINS | grep $rdom`" == "" ]] ; then >+ DOMAINS="$rdom $DOMAINS" >+ fi >+ done >+ >+ if [[ "$PARALLEL_SHUTDOWN" == "yes" ]] ; then > for dom in $DOMAINS ; do > name=$(get_domname ${dom}) > if is_running ${name} ; then >@@ -87,21 +139,50 @@ > einfo " Not stopping domain ${name} - not running" > fi > done >- einfo " Waiting for shutdown of domains that are still running" >- wait >- eend $? >+ einfo " Waiting ${MAXWAIT} seconds for shutdown of domains that are still running" >+ counter=0 >+ while domains_running ; do >+ if [[ ${counter} -gt ${MAXWAIT} ]] ; then >+ break >+ fi >+ sleep 1 >+ let counter=$counter+1 >+ echo -n . >+ done > else > for dom in $DOMAINS ; do > name=$(get_domname ${dom}) > if is_running ${name} ; then >- ebegin " Waiting for domain ${name} to shutdown" >- xl shutdown -w ${name} >/dev/null >- eend $? >+ ebegin " Waiting ${MAXWAIT} seconds for domain ${name} to shutdown" >+ xl shutdown ${name} >/dev/null >+ counter=0 >+ while is_running ${name} ; do >+ if [[ ${counter} -gt ${MAXWAIT} ]] >+ then >+ break >+ fi >+ sleep 1 >+ let counter=$counter+1 >+ echo -n . >+ done > else > einfo " Not stopping domain ${name} - not running" > fi > done > fi >+ >+ # Destroying remaining domains >+ DOMAINS="$(/usr/sbin/xl vm-list|awk '{print $3}'|grep -v "^name$")" >+ for dom in $DOMAINS ; do >+ name=$(get_domname ${dom}) >+ if is_running ${name} ; then >+ ebegin " Destroying running domain ${name}..." >+ xl destroy ${name} >/dev/null >+ else >+ einfo " Not stopping domain ${name} - not running" >+ fi >+ done >+ > if using_screen ; then > if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then > ebegin "Closing screen session ${SCREEN_NAME}"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 529972
: 389906 |
389908