问题描述:

When I start LXC container based on CentOs 5.11 my tty1-tty4 on host system is catched by LXC container.

In the middle of LXC container start-up I see an error on a hosts tty1: udevd-event wait_for_sysfs ioerr_cnt failed

After that the containers init start-up is appear on hosts tty1 (???) And getty eats 100% CPU on host.

The containers config:

# cat /var/lib/lxc/201/config

lxc.utsname = back_server_new201

#NAT Public MGMT network

lxc.network.type = veth

lxc.network.flags = up

lxc.network.mtu = 1500

lxc.network.link = public-nat

lxc.network.ipv4 = 192.168.0.201/24

lxc.network.name = eth0

lxc.network.veth.pair = veth201.0

#DATA network

lxc.network.type = veth

lxc.network.flags = up

lxc.network.mtu = 1500

lxc.network.link = prvt-srvs

lxc.network.ipv4 = 169.0.0.201/24

lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:1201

lxc.network.name = eth1

lxc.network.veth.pair = veth201.1

#PRIVATE network

lxc.network.type = veth

lxc.network.flags = up

lxc.network.mtu = 1500

lxc.network.link = private

lxc.network.ipv4 = 192.168.1.201/24

lxc.network.name = prvt

lxc.network.veth.pair = veth201.2

lxc.mount = /lxc/config/201/fstab

lxc.rootfs = /lxc/vm/201

lxc.tty = 4

#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

fstab

#cat /lxc/config/201/fstab

none /lxc/vm/201/dev/pts devpts defaults 0 0

none /lxc/vm/201/proc proc defaults 0 0

none /lxc/vm/201/sys sysfs defaults 0 0

/lxc/shared/ /lxc/vm/201/shared none bind 0 0

The host:

#lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 12.04.3 LTS

Release: 12.04

Codename: precise

I read here:

Upstart uses an abstract unix socket for communication between

processes and the init daemon. As it’s an abstract socket, even though

the container doesn’t share the same filesystem as the host, the path

still clashes so upstart in the container can’t bind it and anything

running in the container will talk straight to the host instead. This

has an effect where some things don’t get spawned like getty in our

case. What is worse shutting down the container will likely shutdown

your machine, too. Yes, that’s correct - shutting down the container

set to work with network type none can bring the whole host down. Just

try to run lxc-stop -n none01 in the vagrant and you will see that

your vagrant will halt.

How I can avoid the issue?

相关阅读:
Top