[Nix-dev] /dev/shm inconsistency in chroot

Mark H Weaver mhw at netris.org
Thu Jan 23 20:56:21 CET 2014


Hi,

Sree Harsha Totakura <sreeharsha at totakura.in> writes:

> It has been known for a while that any access to /dev/shm fails inside
> chroot if the host system has /dev/shm symlinked to /run/shm.
>
> The suggested method to deal with this until now is to remove the
> symlink from the host system, create /dev/shm directory and mount a
> tmpfs on it.

[...]

> The above problem can be addressed by passing --chroot-directory=/run to
> the guix-daemon which then includes /run into the list of mounts that
> are to be bind mounted inside chroot.

This proposal would take us in the wrong direction.  We should not solve
this problem by inheriting more directories from the host system, but
rather by inheriting fewer.  Everything that we inherit from the host
system is a potential impurity, and this would add more of them.

We should not inherit /dev from the host system at all, but rather
create it from scratch with just the things we need.  IMO, that's the
only truly proper solution.

Thoughts?

    Mark


More information about the nix-dev mailing list