Skip to content
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

Adds Sysctl support #73

Merged
merged 2 commits into from
Jul 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions Godeps/_workspace/src/github.com/opencontainers/specs/bundle.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libcontainer/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ type Config struct {
// so that these files prevent any writes.
ReadonlyPaths []string `json:"readonly_paths"`

// SystemProperties is a map of properties and their values. It is the equivalent of using
// Sysctl is a map of properties and their values. It is the equivalent of using
// sysctl -w my.property.name value in Linux.
SystemProperties map[string]string `json:"system_properties"`
Sysctl map[string]string `json:"sysctl"`

// Seccomp allows actions to be taken whenever a syscall is made within the container.
// By default, all syscalls are allowed with actions to allow, trap, kill, or return an errno
Expand Down
4 changes: 2 additions & 2 deletions libcontainer/integration/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ func TestMountCmds(t *testing.T) {
}
}

func TestSystemProperties(t *testing.T) {
func TestSysctl(t *testing.T) {
if testing.Short() {
return
}
Expand All @@ -766,7 +766,7 @@ func TestSystemProperties(t *testing.T) {
defer remove(rootfs)

config := newTemplateConfig(rootfs)
config.SystemProperties = map[string]string{
config.Sysctl = map[string]string{
"kernel.shmmni": "8192",
}

Expand Down
2 changes: 1 addition & 1 deletion libcontainer/standard_init_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (l *linuxStandardInit) Init() error {
return err
}

for key, value := range l.config.Config.SystemProperties {
for key, value := range l.config.Config.Sysctl {
if err := writeSystemProperty(key, value); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func createLibcontainerConfig(spec *specs.LinuxSpec) (*configs.Config, error) {
"/proc/sys", "/proc/sysrq-trigger", "/proc/irq", "/proc/bus",
}
}
config.Sysctl = spec.Linux.Sysctl
return config, nil
}

Expand Down