Skip to content

Cgroups mount fix #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2015
Merged

Cgroups mount fix #130

merged 2 commits into from
Jul 16, 2015

Conversation

LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Jul 15, 2015

Because of this there was problems with mounting cgroups in children containers. It tried to mount whole path, which exists on host, but not in container.
ping @mrunalp @hqhq @avagin

LK4D4 added 2 commits July 15, 2015 10:41
Signed-off-by: Alexander Morozov <[email protected]>
@@ -180,18 +180,22 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
if err != nil {
return err
}
relDir, err := filepath.Rel(mm.Root, dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I am reading the code correctly, this doesn't have any effect unless we are planning to set Root to something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand. Can you elaborate?
It seems like this mm.Root always prepended to cgroup path in /proc/self/cgroup
For example if I'm in parent container, I have mm.Root like

/system.slice/docker-bae3c1be58e13929aa6ae2f10ec958e5e27e9a4fb178f256e229c5bc54212d66.scope

and in new container after creation will be in /proc/self/cgroup something like:

/system.slice/docker-bae3c1be58e13929aa6ae2f10ec958e5e27e9a4fb178f256e229c5bc54212d66.scope/docker/ID

I'll retry now though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to print stuff and it looks exactly like I described. Mountpoints in container somehow became pretty weird, like:

cope/docker/8cccc84d71a08a64948c297f7117b777e69fc337b75f2df3fa78c1515f908933

Maybe I did logical mistake somewhere, or maybe it is expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

@LK4D4 Ack, I will test out more from within a docker container.

@mrunalp
Copy link
Contributor

mrunalp commented Jul 16, 2015

LGTM

mrunalp pushed a commit that referenced this pull request Jul 16, 2015
@mrunalp mrunalp merged commit 2598484 into opencontainers:master Jul 16, 2015
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants