xendomains stalls when using XAPI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xen |
Fix Released
|
Unknown
|
|||
xen (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Ubuntu 13.04 Raring amd64
On a Xen system with
$ apt-cache policy xen-utils-common | head -2
xen-utils-common:
Installed: 4.2.1-0ubuntu3.2
/etc/init.
I've just tracked the Debian bug #680528 down as the cause of an init-script hang with xen 4.2 when using the xapi toolstack.
The patch used for this bug-fix was implemented too late in the execution of /etc/init.
a permanently stuck task "/etc/rc2.
$ ps -efly | egrep '(init.
S root 1557 1 0 80 0 740 1110 wait 17:26 ? 00:00:00 /bin/sh /etc/init.d/rc 2
S root 1841 1 0 80 0 3368 3395 skb_re 17:26 ? 00:00:00 /usr/sbin/xcp-fe -daemon
S root 2128 1557 0 80 0 1616 4522 wait 17:26 ? 00:00:00 /bin/bash /etc/rc2.
S root 2131 2128 0 80 0 14360 10966 unix_s 17:26 ? 00:00:00 /usr/sbin/xapi list
S root 2142 1 0 80 0 2968 3395 wait 17:26 ? 00:00:00 /usr/sbin/xcp-fe -daemon
S root 2143 2142 0 80 0 27536 186366 poll_s 17:26 ? 00:00:02 /usr/sbin/xapi -nowatchdog list
The first thing the init script does is run the toolstack's "list" command which is expected to returns true (0) or false. In the case of 'xm' and 'xl' this is fine but for 'xapi' there is no such command-line option (as it is a daemon) and consequently it ends up never returning.
----- /etc/init.
xen list &> /dev/null
if test $? -ne 0
then
exit 0;
fi
-----
"xen" expands to "/usr/sbin/xapi" via /usr/sbin/xen:
----- /usr/sbin/xen -----
TOOLSTACK=$(. /usr/lib/
exec "$TOOLSTACK" "$@"
-----
My changes which fix this issue are in-line below, and result in:
$ ps -efly | egrep '(init.
S root 1876 1 0 80 0 3336 3395 skb_re 19:15 ? 00:00:00 /usr/sbin/xcp-fe -daemon
S root 2172 1 0 80 0 10652 10966 unix_s 19:15 ? 00:00:00 /usr/sbin/xapi -daemon -writereadyfile /var/run/
S root 2175 1 0 80 0 2968 3395 wait 19:15 ? 00:00:00 /usr/sbin/xcp-fe -daemon
S root 2176 2175 0 80 0 24800 184294 poll_s 19:15 ? 00:00:00 /usr/sbin/xapi -nowatchdog -writereadyfile /var/run/
-----
# diff -u xendomains.bugged xendomains
--- xendomains.bugged 2013-06-26 17:13:17.239660000 +0100
+++ xendomains 2013-06-26 17:14:17.643660000 +0100
@@ -17,12 +17,6 @@
. /lib/init/vars.sh
. /lib/lsb/
-xen list &> /dev/null
-if test $? -ne 0
-then
- exit 0;
-fi
-
TOOLSTACK=
if [ $? -ne 0 ]; then
@@ -32,6 +26,12 @@
exit 0
fi
+xen list &> /dev/null
+if test $? -ne 0
+then
+ exit 0;
+fi
+
if ! [ -e /proc/xen/privcmd ]; then
exit 0
fi
Changed in ubuntu-xen: | |
status: | Unknown → Fix Released |