Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Conversation

@laijs
Copy link
Contributor

@laijs laijs commented Aug 30, 2017

fix #323

All containers in the pod share the same ipc namespace. However,
posix ipc primitives are shm_open() family whose behaviors
implemented in glibc are to create&share the shm objects within
/dev/shm (or scans /proceed/mounts for any tmpfs if /dev/shm
is not tmpfs).
So we have to create the only one tmpfs mount and share it
to all the containers.

Signed-off-by: Lai Jiangshan jiangshanlai@gmail.com

fix hyperhq#323

All containers in the pod share the same ipc namespace. However,
posix ipc primitives are shm_open() family whose behaviors
implemented in glibc are to create&share the shm objects within
/dev/shm (or scans /proceed/mounts for any tmpfs if /dev/shm
is not tmpfs).
So we have to create the only one tmpfs mount and share it
to all the containers.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
*/
static int hyper_setup_shm(struct hyper_pod *pod)
{
if (hyper_mkdir("/tmp/hyper/shm", 0755) < 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it good to be placed in /tmp? how about /var/lib or somewhere like?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in hyperstart, all pod/containers related things are created on /tmp/hyper

@bergwolf
Copy link
Member

lgtm!

@gnawux gnawux merged commit 6273c32 into hyperhq:master Aug 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

all containers need to share the same /dev/shm

3 participants