summaryrefslogtreecommitdiff
path: root/cmd/podman/shared/create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-10 14:58:41 -0700
committerGitHub <noreply@github.com>2019-10-10 14:58:41 -0700
commitfd389d28ce2223550c82d809cbafa12a54e733e6 (patch)
treeaf13237275b82f7635ee06e2d079c7630926cdd5 /cmd/podman/shared/create.go
parentcec8edd6f5067ea8336fe9d386b78ed1e7161fd6 (diff)
parent5963077e93937046b6b13d6f1da8c1f932c0e6ff (diff)
downloadpodman-fd389d28ce2223550c82d809cbafa12a54e733e6.tar.gz
podman-fd389d28ce2223550c82d809cbafa12a54e733e6.tar.bz2
podman-fd389d28ce2223550c82d809cbafa12a54e733e6.zip
Merge pull request #4206 from giuseppe/systemd-mode-look-full-path
systemd: expect full path /usr/sbin/init
Diffstat (limited to 'cmd/podman/shared/create.go')
-rw-r--r--cmd/podman/shared/create.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 9020613c5..7c56db8db 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -662,9 +662,17 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
return nil, errors.Errorf("invalid image-volume type %q. Pick one of bind, tmpfs, or ignore", c.String("image-volume"))
}
- var systemd bool
- if command != nil && c.Bool("systemd") && ((filepath.Base(command[0]) == "init") || (filepath.Base(command[0]) == "systemd")) {
- systemd = true
+ systemd := c.String("systemd") == "always"
+ if !systemd && command != nil {
+ x, err := strconv.ParseBool(c.String("systemd"))
+ if err != nil {
+ return nil, errors.Wrapf(err, "cannot parse bool %s", c.String("systemd"))
+ }
+ if x && (command[0] == "/usr/sbin/init" || (filepath.Base(command[0]) == "systemd")) {
+ systemd = true
+ }
+ }
+ if systemd {
if signalString == "" {
stopSignal, err = signal.ParseSignal("RTMIN+3")
if err != nil {