Browse code

daemon: ensure systemd cgroup is passed down to runtimes

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

Antonio Murdaca authored on 2016/08/26 22:33:26
Showing 2 changed files
... ...
@@ -566,11 +566,7 @@ func verifyDaemonSettings(config *Config) error {
566 566
 	if config.Runtimes == nil {
567 567
 		config.Runtimes = make(map[string]types.Runtime)
568 568
 	}
569
-	stockRuntimeOpts := []string{}
570
-	if UsingSystemd(config) {
571
-		stockRuntimeOpts = append(stockRuntimeOpts, "--systemd-cgroup=true")
572
-	}
573
-	config.Runtimes[stockRuntimeName] = types.Runtime{Path: DefaultRuntimeBinary, Args: stockRuntimeOpts}
569
+	config.Runtimes[stockRuntimeName] = types.Runtime{Path: DefaultRuntimeBinary}
574 570
 
575 571
 	return nil
576 572
 }
... ...
@@ -20,6 +20,9 @@ func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Contain
20 20
 	if rt == nil {
21 21
 		return nil, fmt.Errorf("no such runtime '%s'", container.HostConfig.Runtime)
22 22
 	}
23
+	if UsingSystemd(daemon.configStore) {
24
+		rt.Args = append(rt.Args, "--systemd-cgroup=true")
25
+	}
23 26
 	createOptions = append(createOptions, libcontainerd.WithRuntime(rt.Path, rt.Args))
24 27
 
25 28
 	return &createOptions, nil