diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-10-15 15:42:12 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2018-10-15 16:19:11 -0400 |
commit | 57a8c2e5e844ee403c9a703c621780de7c7343f0 (patch) | |
tree | 20a2acfd315cdfcc1f472c18508cd53b1dfedc47 /pkg/spec/createconfig.go | |
parent | 2bc9a3c4bbaade50264b1dbf348d1521cdd8d8b5 (diff) | |
download | podman-57a8c2e5e844ee403c9a703c621780de7c7343f0.tar.gz podman-57a8c2e5e844ee403c9a703c621780de7c7343f0.tar.bz2 podman-57a8c2e5e844ee403c9a703c621780de7c7343f0.zip |
Mount proper cgroup for systemd to manage inside of the container.
We are still requiring oci-systemd-hook to be installed in order to run
systemd within a container. This patch properly mounts
/sys/fs/cgroup/systemd/libpod_parent/libpod-UUID on /sys/fs/cgroup/systemd inside of container.
Since we need the UUID of the container, we needed to move Systemd to be a config option of the
container.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/spec/createconfig.go')
-rw-r--r-- | pkg/spec/createconfig.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index d34b21189..6ac9d82da 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -319,6 +319,10 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime) ([]lib if c.Interactive { options = append(options, libpod.WithStdin()) } + if c.Systemd && (strings.HasSuffix(c.Command[0], "init") || + strings.HasSuffix(c.Command[0], "systemd")) { + options = append(options, libpod.WithSystemd()) + } if c.Name != "" { logrus.Debugf("appending name %s", c.Name) options = append(options, libpod.WithName(c.Name)) |