summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container_create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-11 13:32:21 -0400
committerGitHub <noreply@github.com>2020-08-11 13:32:21 -0400
commitaa66c062e993257a040dbe5e13797062ab590926 (patch)
tree69027d9f656cd8faf5f6269663cf2a38cdba5328 /pkg/specgen/generate/container_create.go
parent6d3075a6c79a6e761c183e0d5e6aa239fad21b63 (diff)
parent846d4c2e0139d75d3ff082b9140921dcd657149c (diff)
downloadpodman-aa66c062e993257a040dbe5e13797062ab590926.tar.gz
podman-aa66c062e993257a040dbe5e13797062ab590926.tar.bz2
podman-aa66c062e993257a040dbe5e13797062ab590926.zip
Merge pull request #7288 from tiran/systemd_local_init
Enable systemd mode for /usr/local/sbin/init
Diffstat (limited to 'pkg/specgen/generate/container_create.go')
-rw-r--r--pkg/specgen/generate/container_create.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 4635b755b..fda4c098c 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -164,13 +164,19 @@ 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") {
+ useSystemdCommands := map[string]bool{
+ "/sbin/init": true,
+ "/usr/sbin/init": true,
+ "/usr/local/sbin/init": true,
+ }
+ if useSystemdCommands[command[0]] || (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