From 3ba3e1c7510d1780b6527a4aa52e40ac2c5b576a Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 6 Oct 2019 11:11:29 +0200 Subject: systemd: expect full path /usr/sbin/init "init" is a quite common name for the command executed in a container image and Podman ends up using the systemd mode also when not required. Be stricter on enabling the systemd mode and not enable it automatically when the basename is "init" but expect the full path "/usr/sbin/init". Signed-off-by: Giuseppe Scrivano --- pkg/spec/createconfig.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index a65263b7d..3685450f0 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -195,8 +195,7 @@ func (c *CreateConfig) getContainerCreateOptions(runtime *libpod.Runtime, pod *l if c.Interactive { options = append(options, libpod.WithStdin()) } - if c.Systemd && (strings.HasSuffix(c.Command[0], "init") || - strings.HasSuffix(c.Command[0], "systemd")) { + if c.Systemd { options = append(options, libpod.WithSystemd()) } if c.Name != "" { -- cgit v1.2.3-54-g00ecf