summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-25 23:26:52 +0100
committerGitHub <noreply@github.com>2021-01-25 23:26:52 +0100
commit6ba8819d336ed3514b57c5818123ddfac80555ef (patch)
tree75f6d959c5fc147d5f8aacc85b1b525517dd8e8c /libpod/runtime.go
parentb902ad9375eb77ebc75f4d0742764e02250bc5c5 (diff)
parent5350254f0578162c226f8990f9835b7920bf9835 (diff)
downloadpodman-6ba8819d336ed3514b57c5818123ddfac80555ef.tar.gz
podman-6ba8819d336ed3514b57c5818123ddfac80555ef.tar.bz2
podman-6ba8819d336ed3514b57c5818123ddfac80555ef.zip
Merge pull request #9090 from mheon/sync_shutdown
[NO TESTS NEEDED] Ensure shutdown handler access is syncronized
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 34c737a67..0dc220b52 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -180,6 +180,13 @@ func newRuntimeFromConfig(ctx context.Context, conf *config.Config, options ...R
}
}
+ if err := shutdown.Register("libpod", func(sig os.Signal) error {
+ os.Exit(1)
+ return nil
+ }); err != nil && errors.Cause(err) != shutdown.ErrHandlerExists {
+ logrus.Errorf("Error registering shutdown handler for libpod: %v", err)
+ }
+
if err := shutdown.Start(); err != nil {
return nil, errors.Wrapf(err, "error starting shutdown signal handler")
}
@@ -188,13 +195,6 @@ func newRuntimeFromConfig(ctx context.Context, conf *config.Config, options ...R
return nil, err
}
- if err := shutdown.Register("libpod", func(sig os.Signal) error {
- os.Exit(1)
- return nil
- }); err != nil && errors.Cause(err) != shutdown.ErrHandlerExists {
- logrus.Errorf("Error registering shutdown handler for libpod: %v", err)
- }
-
return runtime, nil
}