Files
systemd/src
Alban Crequy 81f5049b7c nspawn: fallback on bind mount when mknod fails
Some systems abusively restrict mknod, even when the device node already
exists in /dev. This is unfortunate because it prevents systemd-nspawn
from creating the basic devices in /dev in the container.

This patch implements a workaround: when mknod fails, fallback on bind
mounts.

Additionally, /dev/console was created with a mknod with the same
major/minor as /dev/null before bind mounting a pts on it. This patch
removes the mknod and creates an empty regular file instead.

In order to test this patch, I used the following configuration, which I
think should replicate the system with the abusive restriction on mknod:

  # grep devices /proc/self/cgroup
  4:devices:/user.slice/restrict
  # cat /sys/fs/cgroup/devices/user.slice/restrict/devices.list
  c 1:9 r
  c 5:2 rw
  c 136:* rw
  # systemd-nspawn --register=false -D .

v2:
 - remove "bind", it is not needed since there is already MS_BIND
v3:
 - fix error management when calling touch()
 - fix lowercase in error message
2015-03-31 17:21:03 +02:00
..
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-03-19 14:11:54 +01:00
2015-02-23 23:53:42 +01:00
2015-03-11 16:59:53 +01:00
2015-01-23 09:30:44 -05:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-03-19 21:11:32 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-03-31 15:36:53 +02:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
2015-03-14 23:03:45 -04:00
2015-02-23 23:53:42 +01:00
2015-02-23 23:53:42 +01:00
…