mirror of
https://github.com/containers/podman.git
synced 2025-10-19 04:03:23 +08:00
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>
This commit is contained in:
@ -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 {
|
if ctr.config.Spec.Process.Terminal {
|
||||||
args = append(args, "-t")
|
args = append(args, "-t")
|
||||||
|
Reference in New Issue
Block a user