Re: [Lxc-users] lxc-execute: Input/output error - failed to read

2011-01-07 Thread Daniel Lezcano
On 01/07/2011 03:13 AM, Mike Ivanov wrote:
 On 11-01-06 6:02 PM, Mike Ivanov wrote:
 # lxc-execute -n xxx -f config /bin/bash
 r...@xxx:/# lxc-execute: Input/output error - failed to read
 BTW, exactly the same happens to containers created with the lxc-sshd
 template.

When you created a system container, you should start it with lxc-start.

lxc-execute is used for application container where a process reaper is 
inserted between lxc-execute and your application. This is why your 
application has the pid 2. I think there is a problem with an 
application container using a rootfs and the console and this is 
certainly a bug but in your case I think you should you just use 
'lxc-start'.

  -- Daniel


--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] lxc-execute: Input/output error - failed to read

2011-01-06 Thread Mike Ivanov
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 procnodev,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
r...@xxx:/# lxc-execute: Input/output error - failed to read
r...@xxx:/# r...@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
r...@xxx:/lxc# pwd
/lxc
r...@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
r...@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
r...@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




--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] lxc-execute: Input/output error - failed to read

2011-01-06 Thread Mike Ivanov
On 11-01-06 6:02 PM, Mike Ivanov wrote:
 # lxc-execute -n xxx -f config /bin/bash
 r...@xxx:/# lxc-execute: Input/output error - failed to read

BTW, exactly the same happens to containers created with the lxc-sshd 
template.

Mike


--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users