diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-05-10 10:44:15 +0200 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-05-10 10:59:04 +0200 |
commit | 157459a638c5f3eebd8904d962c13344b0ef83da (patch) | |
tree | 1dc0bdad18b0749c847a11c7929a3648ffa2c0e3 | |
parent | 54bed1025d07bc5f77ee4e1e7f942157e211ec0a (diff) | |
download | podman-157459a638c5f3eebd8904d962c13344b0ef83da.tar.gz podman-157459a638c5f3eebd8904d962c13344b0ef83da.tar.bz2 podman-157459a638c5f3eebd8904d962c13344b0ef83da.zip |
fix container startup for empty pidfile
Commit 728b73d7c418 introduced a regression. Containers created with a
previous version do no longer start successfully. The problem is that
the PidFile in the container config is empty for those containers. If
the PidFile is empty we have to set it to the previous default.
[NO TESTS NEEDED] We should investigate why the system upgrade test did
not caught this.
Fixes #10274
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
-rw-r--r-- | libpod/oci_conmon_linux.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 1b1d4ad59..3da49b85f 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -1016,7 +1016,12 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co } } - args := r.sharedConmonArgs(ctr, ctr.ID(), ctr.bundlePath(), ctr.config.PidFile, ctr.LogPath(), r.exitsDir, ociLog, ctr.LogDriver(), logTag) + pidfile := ctr.config.PidFile + if pidfile == "" { + pidfile = filepath.Join(ctr.state.RunDir, "pidfile") + } + + args := r.sharedConmonArgs(ctr, ctr.ID(), ctr.bundlePath(), pidfile, ctr.LogPath(), r.exitsDir, ociLog, ctr.LogDriver(), logTag) if ctr.config.Spec.Process.Terminal { args = append(args, "-t") |