diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-08-01 11:34:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 11:34:17 +0200 |
commit | 271a9f45a462c652d4f025f583fc3bd204d95656 (patch) | |
tree | b5a3b70333378b1893b14101f5740f9469845d6b /pkg/systemd/generate/containers.go | |
parent | f5f7909932dc314612539dabf8682b17c6e20970 (diff) | |
parent | 6a9338ad6cb6c6c65fae7786b35636f260389ea9 (diff) | |
download | podman-271a9f45a462c652d4f025f583fc3bd204d95656.tar.gz podman-271a9f45a462c652d4f025f583fc3bd204d95656.tar.bz2 podman-271a9f45a462c652d4f025f583fc3bd204d95656.zip |
Merge pull request #15056 from Luap99/generate-systemd-sdnotify
podman generate systemd: handle --sdnotify correctly
Diffstat (limited to 'pkg/systemd/generate/containers.go')
-rw-r--r-- | pkg/systemd/generate/containers.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go index 6596ef73b..66905202d 100644 --- a/pkg/systemd/generate/containers.go +++ b/pkg/systemd/generate/containers.go @@ -403,8 +403,13 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst // Default to --sdnotify=conmon unless already set by the // container. - hasSdnotifyParam := fs.Lookup("sdnotify").Changed - if !hasSdnotifyParam { + sdnotifyFlag := fs.Lookup("sdnotify") + if !sdnotifyFlag.Changed { + startCommand = append(startCommand, "--sdnotify=conmon") + } else if sdnotifyFlag.Value.String() == libpodDefine.SdNotifyModeIgnore { + // If ignore is set force conmon otherwise the unit with Type=notify will fail. + logrus.Infof("Forcing --sdnotify=conmon for container %s", info.ContainerNameOrID) + remainingCmd = removeSdNotifyArg(remainingCmd, fs.NArg()) startCommand = append(startCommand, "--sdnotify=conmon") } |