[Pkg-xen-devel] Bug#648029: xen-utils-common: /usr/lib/xen-common/bin/xen-toolstack (and thus /usr/sbin/xm) works with bash, but not dash

Lionel Elie Mamane lionel at mamane.lu
Tue Nov 8 11:58:32 UTC 2011


Package: xen-utils-common
Version: 4.1.2-1
Severity: grave
Justification: renders package unusable

(Grave because dash is the default /bin/sh)

With dash 0.5.5.1-7.4 as /bin/sh, /usr/sbin/xm enters an infinite loop
of reexcuting itself. When run with bash, it works correctly.

I traced that to /usr/lib/xen-common/bin/xen-toolstack; here's the
diff between "/bin/sh -x /usr/sbin/xm" and "/bin/bash -x /usr/sbin/xm";
the output of "/bin/bash -x /usr/sbin/xm" has been post-processed to
remove spurious differences, such as multiple "+" at start of line
(that in bash show recursion/inclusion level), "'['" vs "[", etc.

 + [ -z  ]
 + check xm
 + [ xm = xm ]
-+ PATH=/usr/lib/xen-4.1/bin command -v xm
-+ cmd_xm=/usr/sbin/xm
++ PATH=/usr/lib/xen-4.1/bin
++ command -v xm
++ cmd_xm=/usr/lib/xen-4.1/bin/xm
 + check xl
 + [ xl = xm ]
 + [ xl = xl ]
-+ PATH=/usr/lib/xen-4.1/bin command -v xl
-+ cmd_xl=/usr/sbin/xl
-+ [ /usr/sbin/xm ]
-+ echo /usr/sbin/xm
-+ TOOLSTACK=/usr/sbin/xm
++ PATH=/usr/lib/xen-4.1/bin
++ command -v xl
++ cmd_xl=/usr/lib/xen-4.1/bin/xl
++ [ /usr/lib/xen-4.1/bin/xm ]
++ echo /usr/lib/xen-4.1/bin/xm
++ TOOLSTACK=/usr/lib/xen-4.1/bin/xm
 + RET=0
 + [ 0 -eq 0 ]
-+ basename /usr/sbin/xm
++ basename /usr/lib/xen-4.1/bin/xm
 + [ xm != xm ]
-+ exec /usr/sbin/xm
++ exec /usr/lib/xen-4.1/bin/xm

Plainly, the idiom "PATH=FOO command -v bar" does not work with
dash. This seems to work:

 local PATH_old
 PATH_old="${PATH}"
 PATH=FOO
 command -v bar
 PATH="${PATH_old}"

Or maybe more devious (but untested):

 local PATH
 PATH=FOO
 command -v bar

-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable'), (400, 'testing'), (300, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-xen-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_LU.UTF-8, LC_CTYPE=fr_LU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xen-utils-common depends on:
ii  gawk                    1:3.1.7.dfsg-5   GNU awk, a pattern scanning and pr
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii  udev                    164-3            /dev/ and hotplug management daemo
ii  xenstore-utils          4.0.1-4          Xenstore utilities for Xen

xen-utils-common recommends no packages.

xen-utils-common suggests no packages.

-- Configuration Files:
/etc/xen/xend-config.sxp changed:
(network-script 'network-camp netdev=eth0 bridge=xenbr0')
(vif-script 'vif-bridge bridge=xenbr0')
(dom0-min-mem 196)
(enable-dom0-ballooning yes)
(total_available_memory 0) 
(dom0-cpus 0)
(vncpasswd '')
(keymap 'fr-be')


-- no debconf information





More information about the Pkg-xen-devel mailing list