[lxc-users] Question on running 2 processes in 2 containers creating a lock file in /var/locks

Serge Hallyn serge.hallyn at ubuntu.com
Fri Aug 1 16:44:22 UTC 2014


It's doable, but complicated by the fact that the container inits will
want to link /run/lock onto /var/locks, where /run is a tmpfs.  But
you can just add

lxc.mount.entry = /var/locks var/locks none bind,create=dir 0 0

to make the host /var/locks show up in the container.  Up to you do
then do the right thing with init :)

Quoting Anjali Kulkarni (anjali at juniper.net):
> Hi,
> 
> I am interested in running 2 processes in 2 containers, each creating a
> file in /var/locks.
> But I don't see a /var/locks in the container rootfs:
> 
> ls /var/lib/lxc/test/rootfs/var/locks
> ls: cannot access /var/lib/lxc/test/rootfs/var/locks: No such file or
> directory
> 
> Is there a way this can be done? Can each container mount the host's
> /var/locks, and then create their own lock file in it?
> 
> 
> Anjali
> 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list