[Lxc-users] IPC with shared memory?

Serge Hallyn serge.hallyn at canonical.com
Thu Dec 13 11:56:22 UTC 2012


Quoting Binknight (zheng_huabin at 163.com):
> hi, 
>     i have two processes running in two containers on the same hardware node, they are expected to communicate with shared memory IPC mechanism, but it turned out to be failed.  It seems that the shared memory created in one container is not visible to process in other container because different namespace. is there any way to address this problem?

Hm, I thought you could specify the namespaces to be unshared in
lxc.conf, but I see you can't.  Given the flexibility that lxc
strives toward I find that surprising.  Please feel free to write
a simple patch to add an lxc.ns option to lxc.conf, and use that
in start.c to pick the namespaces to unshare.

Then you would create a shell in a new IPC ns,

	lxc-unshare -s IPC -- /bin/bash

and from there start the two containers without IPC in their clone
flags, so that they would share an IPC ns with each other, but not
with the host.

-serge




More information about the lxc-users mailing list