summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-31 19:19:08 +0200
committerGitHub <noreply@github.com>2022-08-31 19:19:08 +0200
commit07413f2035a22e8766a723349b3a4a8ae17b8898 (patch)
treee9a7e57d9659351366938ba0f3f534be8d22f19a
parent8266dbe7a90f6f03995b42315b3ac2da54cd018f (diff)
parentfed4ce0ea9a9c85b45f5f6733f82051ea3a179db (diff)
downloadpodman-07413f2035a22e8766a723349b3a4a8ae17b8898.tar.gz
podman-07413f2035a22e8766a723349b3a4a8ae17b8898.tar.bz2
podman-07413f2035a22e8766a723349b3a4a8ae17b8898.zip
Merge pull request #15566 from mheon/fix_15557
Inhibit SIGTERM during Conmon startup
-rw-r--r--libpod/container_internal.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 60fb29607..7d390ec21 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -27,6 +27,7 @@ import (
cutil "github.com/containers/common/pkg/util"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/libpod/events"
+ "github.com/containers/podman/v4/libpod/shutdown"
"github.com/containers/podman/v4/pkg/ctime"
"github.com/containers/podman/v4/pkg/lookup"
"github.com/containers/podman/v4/pkg/rootless"
@@ -1038,6 +1039,13 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
}
}
+ // To ensure that we don't lose track of Conmon if hit by a SIGTERM
+ // in the middle of setting up the container, inhibit shutdown signals
+ // until after we save Conmon's PID to the state.
+ // TODO: This can likely be removed once conmon-rs support merges.
+ shutdown.Inhibit()
+ defer shutdown.Uninhibit()
+
// With the spec complete, do an OCI create
if _, err = c.ociRuntime.CreateContainer(c, nil); err != nil {
return err
@@ -1073,6 +1081,7 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
if err := c.save(); err != nil {
return err
}
+
if c.config.HealthCheckConfig != nil {
if err := c.createTimer(); err != nil {
logrus.Error(err)