M
M
myppomeu2016-02-15 11:39:13
linux
myppomeu, 2016-02-15 11:39:13

How to allow access to /dev/null in an LXC container?

There is no access to /dev/null inside the LXC container:

/usr/sbin/ejabberdctl: line 446: /dev/null: Permission denied

Debian 8x64. The container is located in a folder on the ext4 file system. Config:
lxc.mount = /media/Storage/DRIVERS/LXC/xmpp_transports/fstab
lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry = sysfs sys sysfs ro 0 0
lxc.tty = 4
lxc.pts = 1024
lxc.arch = x86_64
lxc.seccomp = /usr/share/lxc/config/common.seccomp
lxc.kmsg = 0
lxc.autodev = 1
lxc.cgroup.devices.deny = a
lxc.cgroup.devices.allow = c *:* m
lxc.cgroup.devices.allow = b *:* m
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 5:2 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 254:0 rm
lxc.cgroup.devices.allow = c 10:229 rwm
lxc.cgroup.devices.allow = c 10:200 rwm
lxc.cgroup.devices.allow = c 1:7 rwm
lxc.cgroup.devices.allow = c 10:228 rwm
lxc.cgroup.devices.allow = c 10:232 rwm
lxc.utsname = xmpp_transports
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 00:16:3e:21:3d:70
lxc.network.ipv4.gateway = 192.168.79.1
lxc.network.ipv4 = 192.168.79.10/8
lxc.cap.drop = sys_module
lxc.cap.drop = mac_admin
lxc.cap.drop = mac_override
lxc.cap.drop = sys_time
lxc.rootfs = /media/Storage/DRIVERS/LXC/xmpp_transports/rootfs
lxc.pivotdir = lxc_putold

The partition on which the container is located was mounted with both the dev option and the nodev option.
/dev/null inside the container recreated
# ls -la /dev/null 
crw-rw-rw- 1 root root 1, 3 фев 15 13:30 /dev/null

At the same time , the container
dd if=/dev/zero of=/dev/null
operation
log works .
I would be very grateful for a hint what the problem is.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
myppomeu, 2016-02-15
@myppomeu

in container:
chmod a+rx /dev

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question