Skip to content

Commit

Permalink
Merge pull request opencontainers#91 from hqhq/hq_add_cgroup_mount
Browse files Browse the repository at this point in the history
Add cgroup mount in the recommended config
  • Loading branch information
Mrunal Patel committed Jul 15, 2015
2 parents da0f867 + d7181a7 commit 42aa891
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ user named `daemon` defined within that file-system.
"source": "sysfs",
"destination": "/sys",
"options": "nosuid,noexec,nodev"
},
{
"type": "cgroup",
"source": "cgroup",
"destination": "/sys/fs/cgroup",
"options": "nosuid,noexec,nodev,relatime,ro"
}
],
"linux": {
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/rootfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
Device: "bind",
Source: filepath.Join(mm.Mountpoint, dir),
Destination: filepath.Join(m.Destination, strings.Join(mm.Subsystems, ",")),
Flags: syscall.MS_BIND | syscall.MS_REC | syscall.MS_RDONLY,
Flags: syscall.MS_BIND | syscall.MS_REC | m.Flags,
})
}
tmpfs := &configs.Mount{
Expand Down
6 changes: 6 additions & 0 deletions spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ var specCommand = cli.Command{
Destination: "/sys",
Options: "nosuid,noexec,nodev",
},
{
Type: "cgroup",
Source: "cgroup",
Destination: "/sys/fs/cgroup",
Options: "nosuid,noexec,nodev,relatime,ro",
},
},
},
Linux: specs.Linux{
Expand Down

0 comments on commit 42aa891

Please sign in to comment.