Package: lxc
Version: 0.7.5-5
Severity: normal
Tags: patch
Hi! chroot commands run at the end of lxc-debian for disabling some init
scripts (yep, the same ones mentioned in #636851) are malformed. They go
like this:
chroot $rootfs "LANG=C /path/to/command arg1 arg2 arg3"
when they should go like:
chroot $rootfs sh -c "LANG=C /path/to/command arg1 arg2 arg3"
since each nonoption argument to chroot is used as an individual argument
going straight to exec, not sh. Thanks!
Output of "lxc-debian -n debtest1 -p /var/lib/lxc/debtest1" (unpatched):
------
Checking cache download in /var/cache/lxc/debian/rootfs-squeeze-amd64 ...
Copying rootfs to /var/lib/lxc/debtest1/rootfs...Generating locales (this might
take a while)...
Generation complete.
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d -f checkroot.sh
remove': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d checkroot.sh stop
09 S .': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d -f umountfs
remove': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d umountfs start 09 0
6 .': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d -f umountroot
remove': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d umountroot start 10
0 6 .': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d -f hwclock.sh
remove': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d hwclock.sh start 10
3 .': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d -f hwclockfirst.sh
remove': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d hwclockfirst start
08 3 .': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d -f
module-init-tools remove': No such file or directory
chroot: failed to run command `LANG=C /usr/sbin/update-rc.d module-init-tools
start 10 3 .': No such file or directory
Root password is 'T8S+S/YJ', please change !
------
Output of "lxc-debian -n debtest2 -p /var/lib/lxc/debtest2" (patched):
------
Checking cache download in /var/cache/lxc/debian/rootfs-squeeze-amd64 ...
Copying rootfs to /var/lib/lxc/debtest2/rootfs...Generating locales (this might
take a while)...
Generation complete.
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: checkroot.sh start runlevel arguments (none) do not match
LSB Default-Start values (S)
update-rc.d: warning: checkroot.sh stop runlevel arguments (S) do not match LSB
Default-Stop values (none)
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: hwclock.sh start runlevel arguments (3) do not match LSB
Default-Start values (S)
update-rc.d: warning: hwclock.sh stop runlevel arguments (none) do not match
LSB Default-Stop values (0 6)
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/hwclockfirst
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d/module-init-tools
Root password is 'InQzp/17', please change !
------
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages lxc depends on:
ii debconf [debconf-2.0] 1.5.41
ii libc6 2.13-21
ii libcap2 1:2.22-1
Versions of packages lxc recommends:
ii debootstrap 1.0.37
ii libcap2-bin 1:2.22-1
Versions of packages lxc suggests:
pn lxctl <none>
-- debconf information:
lxc/shutdown: stop
lxc/directory:
lxc/title:
lxc/auto: true
--- /usr/lib/lxc/templates/lxc-debian.orig 2011-11-06 08:14:14.000000000 +0100
+++ /usr/lib/lxc/templates/lxc-debian 2011-11-11 15:42:30.090688705 +0100
@@ -94,26 +94,26 @@
chroot $rootfs sh -c "LANG=C dpkg-reconfigure locales -f noninteractive"
# remove pointless services in a container
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d -f checkroot.sh remove" # S
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d checkroot.sh stop 09 S ."
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d -f checkroot.sh remove" # S
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d checkroot.sh stop 09 S ."
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d -f umountfs remove" # 0 6
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d umountfs start 09 0 6 ."
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d -f umountfs remove" # 0 6
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d umountfs start 09 0 6 ."
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d -f umountroot remove" # 0 6
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d umountroot start 10 0 6 ."
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d -f umountroot remove" # 0 6
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d umountroot start 10 0 6 ."
# The following initscripts don't provide an empty start or stop block.
# To prevent them being enabled on upgrades, we leave a start link on
# runlevel 3.
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d -f hwclock.sh remove" # S 0 6
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d hwclock.sh start 10 3 ."
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d -f hwclock.sh remove" # S 0 6
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d hwclock.sh start 10 3 ."
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d -f hwclockfirst.sh remove" # S
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d hwclockfirst start 08 3 ."
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d -f hwclockfirst.sh remove" # S
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d hwclockfirst start 08 3 ."
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d -f module-init-tools remove" # S
- chroot $rootfs "LANG=C /usr/sbin/update-rc.d module-init-tools start 10 3 ."
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d -f module-init-tools remove" # S
+ chroot $rootfs sh -c "LANG=C /usr/sbin/update-rc.d module-init-tools start 10 3 ."
password="$(dd if=/dev/urandom bs=6 count=1 2> /dev/null | base64)"