Quoting Adam Ryczkowski ([email protected]):
> On Ubuntu, LXC has a nice feature, that allows to execute the script
> automatically upon boot, if the link to the configuration file is
> present on /etc/lxc/auto.
> 
> Unfortunately I need to call a mount-binding script on host before,
> so my container can see an external directory.
> 
> The script is simple:
> mount --bind /mnt/shared-folder /mnt/shared-folder
> mount --make-inbindable /mnt/shared-folder
> mount --make-shared /mnt/shared-folder

You can use 'lxc.hook.pre-mount' (see lxc.conf or lxc.container.conf
manpage for this), which is called in the container's mounts
namespace, but without the container rootfs set up.  You can
also use 'lxc.hook.mount', which is called later, after the
rootfs has been setup, but before it has done pivot_root, so you
stil have the host / available.

-serge
_______________________________________________
lxc-users mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to