[Lxc-users] lxc-execute: Input/output error - failed to read
Mike Ivanov
mikei at activestate.com
Fri Jan 7 02:02:25 UTC 2011
Hi there,
This is what happens on a freshly installed Ubuntu 10.10 Maverick
Meerkat (2.6.35):
# lxc-version
lxc version: 0.7.2
# mkdir /lxc
# /usr/lib/lxc/templates/lxc-ubuntu -p /lxc
.....
I: Retrieving tar
I: Validating tar
I: Retrieving tzdata
I: Validating tzdata
I: Retrieving udev
.....
Please change root-password !
# ls
config fstab rootfs
# cat config
lxc.utsname = xxx
lxc.tty = 4
lxc.pts = 1024
lxc.rootfs = /lxc/rootfs
lxc.mount = /lxc/fstab
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
# cat fstab
proc /lxc/rootfs/proc proc nodev,noexec,nosuid 0 0
devpts /lxc/rootfs/dev/pts devpts defaults 0 0
sysfs /lxc/rootfs/sys sysfs defaults 0 0
All was perfect so far.
Now, this is the place where things become less beautiful:
# lxc-execute -n xxx -f config /bin/bash
root at xxx:/# lxc-execute: Input/output error - failed to read
root at xxx:/# root at xxx:/# exit
[2]+ Stopped lxc-execute -n xxx -f config /bin/bash
# fg
lxc-execute -n xxx -f config /bin/bash
#
Note it somehow manages to send itself to background.
lxc-start simply hangs. When /sbin/init is started with --verbose it
says somewhere in the middle:
init: mountall main process (3) executable changed
init: hostname main process (4) terminated with status 1
init: hostname goal changed from start to stop
Now, what's interesting, if I comment out the lxc.rootfs line in config,
it gives me perfectly functional bash:
# lxc-execute -n xxx -f config /bin/bash
root at xxx:/lxc# pwd
/lxc
root at xxx:/lxc# ps ax
PID TTY STAT TIME COMMAND
1 ? S 0:00 /usr/lib/lxc/lxc-init -- /bin/bash
2 ? S 0:00 /bin/bash
12 ? R+ 0:00 ps ax
root at xxx:/lxc#
Even more interesting: if I add a line like "lxc.rootfs = /" to the
config file ("/" is the default value, right?) it breaks again:
# lxc-execute -n xxx -f config /bin/bash
root at xxx:/# lxc-execute: Input/output error - failed to read
So my question is what I'm doing wrong? If that's not me, is it
something fixed in 0.7.3?
Thanks,
Mike
More information about the lxc-users
mailing list