From ca7376bb115e2d3506a3efe242bde25118f57c39 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Thu, 10 Mar 2022 15:26:34 -0700 Subject: Exit with 0 when receiving SIGTERM * systemctl stop podman.service will now return exit code 0 * Update test framework to support JSON boolean and numeric values Signed-off-by: Jhon Honce --- libpod/runtime.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libpod') diff --git a/libpod/runtime.go b/libpod/runtime.go index d19997709..07653217a 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -210,6 +210,10 @@ func newRuntimeFromConfig(ctx context.Context, conf *config.Config, options ...R } if err := shutdown.Register("libpod", func(sig os.Signal) error { + // For `systemctl stop podman.service` support, exit code should be 0 + if sig == syscall.SIGTERM { + os.Exit(0) + } os.Exit(1) return nil }); err != nil && errors.Cause(err) != shutdown.ErrHandlerExists { -- cgit v1.2.3-54-g00ecf