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 --- cmd/podman/shared/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/podman') diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 9020613c5..675dfbad6 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -663,7 +663,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. } var systemd bool - if command != nil && c.Bool("systemd") && ((filepath.Base(command[0]) == "init") || (filepath.Base(command[0]) == "systemd")) { + if command != nil && c.Bool("systemd") && (command[0] == "/usr/sbin/init" || (filepath.Base(command[0]) == "systemd")) { systemd = true if signalString == "" { stopSignal, err = signal.ParseSignal("RTMIN+3") -- cgit v1.2.3-54-g00ecf