Bind /run recursively
Extends !52 (merged)
/run
mountpoint should be bound recursively since it might contain other mounts inside.
One good example is /run/user/<UID>
. When mounted with --bind
that folder will be empty and owned by root
which in some cases prevents certain applications from running.
In my case I had this setup:
- Chroot with my previous Arch installation from a different PC
- Fresh Arch installation
- I want to run a GUI application from within chroot (let's stick to firefox for example) and get it displayed on my host's wayland display.
- I need to do that under my unprivileged user
This can be easily done by using waypipe but to do that you need to have an access to wayland socket inside chroot. In my case path to wayland socket is /run/user/1000/wayland-0
where 1000
is my UID.
This is how you set this up:
Outside chroot
$ waypipe --socket <CHROOT_PATH>/tmp/waypipe.sock client
Inside chroot under your user
(chroot) # sudo -su <USER>
(chroot) $ export XDG_RUNTIME_DIR=/run/user/1000
(chroot) $ waypipe --socket /tmp/waypipe.sock server firefox
However in current arch-chroot
implementation, if you run this, you will get:
(chroot) $ waypipe --socket waypipe.sock server firefox
S61: 33.859101 [src/util.c:242] Error changing to folder '/run/user/1000'
Because path /run/user/1000
hasn't been mounted:
(chroot) $ ls -l /run/user/
total 0
drwx------ 2 root root 40 Dec 27 22:43 1000
(chroot) $ ls -l /run/user/1000
ls: cannot open directory '/run/user/1000': Permission denied
(chroot) $ sudo ls -l /run/user/1000
total 0
With --rbind
, /run/user/1000
is being bound now as well and the issue disappears.
Also to keep things consistent --make-rprivate
now should be used and to properly unmount /run
umount -R
should be used as well.