aboutsummaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/common.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-08-24 13:58:06 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-08-24 15:46:00 +0200
commit274d6fa19c889eb2f255968a80e8a838c0fe0e45 (patch)
treeb3dbf7be54173a22d866f983ed99d74ea5045046 /pkg/systemd/generate/common.go
parent74ab2aaf9f27e1495a74c37932a634c82af9a57b (diff)
downloadpodman-274d6fa19c889eb2f255968a80e8a838c0fe0e45.tar.gz
podman-274d6fa19c889eb2f255968a80e8a838c0fe0e45.tar.bz2
podman-274d6fa19c889eb2f255968a80e8a838c0fe0e45.zip
generate systemd: use --cidfile again
Commit 9ac5267 changed the type of the generated systemd units from `forking` to `notify`. It further stopped using `--cidfile` and instead intended systemd to take care of stopping the container, which turned out to be a bad idea. Systemd will send the stop/kill signals to conmon which in turn may exit non-zero, depending on the signal, and ultimately breaking container cleanup. Hence, we need to use --cidfile again and let podman stop and remove the container to make sure that everything's in order. Fixes: #11304 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate/common.go')
-rw-r--r--pkg/systemd/generate/common.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/systemd/generate/common.go b/pkg/systemd/generate/common.go
index 45e12014a..49465fb30 100644
--- a/pkg/systemd/generate/common.go
+++ b/pkg/systemd/generate/common.go
@@ -71,11 +71,12 @@ func filterCommonContainerFlags(command []string, argCount int) []string {
case s == "--rm":
// Boolean flags support --flag and --flag={true,false}.
continue
- case s == "--sdnotify", s == "--cgroups":
+ case s == "--sdnotify", s == "--cgroups", s == "--cidfile":
i++
continue
case strings.HasPrefix(s, "--rm="),
- strings.HasPrefix(s, "--cgroups="):
+ strings.HasPrefix(s, "--cgroups="),
+ strings.HasPrefix(s, "--cidfile="):
continue
}
processed = append(processed, s)