From 57a8c2e5e844ee403c9a703c621780de7c7343f0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 15 Oct 2018 15:42:12 -0400 Subject: 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 --- libpod/options.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libpod/options.go') diff --git a/libpod/options.go b/libpod/options.go index 9f966cead..228b38ba5 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -349,6 +349,18 @@ func WithShmDir(dir string) CtrCreateOption { } } +// WithSystemd turns on systemd mode in the container +func WithSystemd() CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return ErrCtrFinalized + } + + ctr.config.Systemd = true + return nil + } +} + // WithShmSize sets the size of /dev/shm tmpfs mount. func WithShmSize(size int64) CtrCreateOption { return func(ctr *Container) error { -- cgit v1.2.3-54-g00ecf