diff options
author | Matthew Heon <mheon@redhat.com> | 2020-12-07 10:00:36 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2020-12-07 10:00:36 -0500 |
commit | bd2cfe0a9336b01122de851c528ad7f3e521af78 (patch) | |
tree | defcf4416ed8d6274705eecbd2236a50d3a3ccdf /libpod/runtime.go | |
parent | dc5da90523f35146f5368a31be7edf39be13beb4 (diff) | |
download | podman-bd2cfe0a9336b01122de851c528ad7f3e521af78.tar.gz podman-bd2cfe0a9336b01122de851c528ad7f3e521af78.tar.bz2 podman-bd2cfe0a9336b01122de851c528ad7f3e521af78.zip |
Do not error on installing duplicate shutdown handler
Installing a duplicate shutdown handler fails, but if a handler
with the same name is already present, we should be set to go.
There's no reason to print a user-facing error about it.
This comes up almost nowhere because Podman never makes more than
one Libpod runtime, but there is one exception (`system reset`)
and the error messages, while harmless, were making people very
confused (we got several bug reports that `system reset` was
nonfunctional).
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 72bd34a5e..1004e4fa7 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -190,7 +190,7 @@ 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 { + }); err != nil && errors.Cause(err) != shutdown.ErrHandlerExists { logrus.Errorf("Error registering shutdown handler for libpod: %v", err) } |