[lxc-devel] call to setup_dev_symlinks with lxc.autodev

William Dauchy wdauchy at gmail.com
Thu Apr 17 09:14:06 UTC 2014


On Wed, Apr 16, 2014 at 9:15 PM, Michael H. Warfield <mhw at wittsend.com> wrote:
> What version of LXC?

1.0.3

> What distro (template) and revision was installed in that container?
> What custom configuration changes have you made?
> Are you running with autodev=0 or autodev=1?
> It sounds like this "system disk" was created as an image file or
> physical disk.  Which and how was it created?

I'm not using any template. Everything made by myself since I'm using
lxc. The system disk is also generated my by own scripts.
Here is my config:

lxc.pivotdir = mnt

## CONSOLES
lxc.tty = 4
lxc.pts = 8

# Capabilities
lxc.cap.drop = sys_boot sys_module sys_time
lxc.cap.drop = net_raw
lxc.cap.drop = mac_override audit_control mac_admin

# Memory
lxc.cgroup.memory.limit_in_bytes = 268435456
lxc.cgroup.memory.memsw.limit_in_bytes = 268435456

# devices
lxc.cgroup.devices.deny = a
lxc.cgroup.devices.allow = c 1:3 rwm # null
lxc.cgroup.devices.allow = c 1:5 rwm # zero
lxc.cgroup.devices.allow = c 1:7 rwm # full
lxc.cgroup.devices.allow = c 1:8 rwm # random
lxc.cgroup.devices.allow = c 1:9 rwm # urandom
lxc.cgroup.devices.allow = c 4:0 rwm # tty1
lxc.cgroup.devices.allow = c 4:1 rwm # tty2
lxc.cgroup.devices.allow = c 4:2 rwm # tty3
lxc.cgroup.devices.allow = c 4:3 rwm # tty4
lxc.cgroup.devices.allow = c 4:4 rwm # tty5
lxc.cgroup.devices.allow = c 4:5 rwm # tty6
lxc.cgroup.devices.allow = c 4:6 rwm # tty7
lxc.cgroup.devices.allow = c 4:7 rwm # tty8
lxc.cgroup.devices.allow = c 5:0 rwm # tty
lxc.cgroup.devices.allow = c 5:1 rwm # console
lxc.cgroup.devices.allow = c 5:2 rwm # ptmx
lxc.cgroup.devices.allow = c 136:* rwm # pts/*

lxc.utsname = cgroups0

lxc.rootfs = /var/lib/lxc/VM_X/rootfs
lxc.autodev = 0
lxc.kmsg = 0

lxc.console = /srv/X/log

lxc.cgroup.cpu.shares = 64

lxc.network.type = veth
lxc.network.name = eth0
lxc.network.link = dev
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:f3:35:93
lxc.network.veth.pair = vethX.0

lxc.network.ipv4 = 10.20.7.236/21
lxc.network.ipv4.gateway = 10.20.7.254
lxc.mount.entry = /srv/X /var/lib/lxc/VM_X/rootfs/ none
ro,bind,nosuid,noatime,nodiratime 0 0
# this hook is just doing a `ls` in the /dev directory
lxc.hook.mount = /usr/bin/setup_dev.sh /srv/X/dev


> On Mon, 2014-04-14 at 15:18 +0200, William Dauchy wrote:
>> but in my case I need to manually access the /dev directory in order
>> to make it return EEXIST.
>
> I don't understand this statement.  What are you doing "in order to make
> it return EEXIST?"  Create the symlinks?  In your previous message, you
> said the 4 symlinks already exist.  Ok...  Then what does this "I need
> to manually access the /dev directory" mean?  What are you doing when
> you do?

I was also quoting the code which is calling the `symlink` function
and should return EEXIST in order to not fail. The thing is I need to
access the directory /dev before starting (see lxc.hook.mount in my
config) to make the `symlink` function return EEXIST. That's a
workaround to make my container start.

I also don't understand what is so difficult to get: it does not make
sense to have options to enable/disable creations of stuff in /dev
(kmsg/autodev), but not for these four links. That's what I need.

Regards,
-- 
William


More information about the lxc-devel mailing list