summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2020-08-11 11:29:49 +0200
committerChristian Heimes <cheimes@redhat.com>2020-08-11 11:41:14 +0200
commit1ae8d2f096e323ad71a8cf8aaf1800d23f29181e (patch)
tree797c938b81907cf6457a40425e0feb225aa72d7b /pkg/specgen/generate
parenta90ae00df1c2be0f3d46d4e7cd292599c93ded0f (diff)
downloadpodman-1ae8d2f096e323ad71a8cf8aaf1800d23f29181e.tar.gz
podman-1ae8d2f096e323ad71a8cf8aaf1800d23f29181e.tar.bz2
podman-1ae8d2f096e323ad71a8cf8aaf1800d23f29181e.zip
Enable systemd mode for /usr/local/sbin/init
Podman 1.6.2 changed systemd mode auto-detection from commands ending in ``init`` to hard-coded paths ``/sbin/init`` and ``/usr/sbin/init``. This broke FreeIPA container. ``podman run`` and ``podman create`` now activate systemd mode when the command is ``/usr/local/sbin/init``. Fixes: https://github.com/containers/podman/issues/7287 Signed-off-by: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/container_create.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index b61ac2c30..a9eae94af 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -164,13 +164,14 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
}
if len(command) > 0 {
- if command[0] == "/usr/sbin/init" || command[0] == "/sbin/init" || (filepath.Base(command[0]) == "systemd") {
+ if command[0] == "/usr/sbin/init" || command[0] == "/sbin/init" || command[0] == "/usr/local/sbin/init" || (filepath.Base(command[0]) == "systemd") {
useSystemd = true
}
}
default:
return nil, errors.Wrapf(err, "invalid value %q systemd option requires 'true, false, always'", s.Systemd)
}
+ logrus.Debugf("using systemd mode: %t", useSystemd)
if useSystemd {
// is StopSignal was not set by the user then set it to systemd
// expected StopSigal