diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-20 11:16:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 11:16:11 -0400 |
commit | 6c0b600e7d49d17db6eedd21b755b5d4f1a15b11 (patch) | |
tree | bacb719aef9c18e181d4014abb37d3a103f7a601 /libpod/runtime_ctr.go | |
parent | 35b4cb196545eee3b072083e716ad4588e0bb486 (diff) | |
parent | f58d2f5e75b4982774509847c18b39f4a50fd5be (diff) | |
download | podman-6c0b600e7d49d17db6eedd21b755b5d4f1a15b11.tar.gz podman-6c0b600e7d49d17db6eedd21b755b5d4f1a15b11.tar.bz2 podman-6c0b600e7d49d17db6eedd21b755b5d4f1a15b11.zip |
Merge pull request #7999 from mheon/signal_handler
Add a shutdown signal handler
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 51b4c5f03..de73a9ff3 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -12,6 +12,7 @@ import ( "github.com/containers/common/pkg/config" "github.com/containers/podman/v2/libpod/define" "github.com/containers/podman/v2/libpod/events" + "github.com/containers/podman/v2/libpod/shutdown" "github.com/containers/podman/v2/pkg/cgroups" "github.com/containers/podman/v2/pkg/rootless" "github.com/containers/storage" @@ -149,6 +150,10 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai return nil, err } + // Inhibit shutdown until creation succeeds + shutdown.Inhibit() + defer shutdown.Uninhibit() + // Allocate a lock for the container lock, err := r.lockManager.AllocateLock() if err != nil { |