summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2022-03-10 15:26:34 -0700
committerJhon Honce <jhonce@redhat.com>2022-03-15 14:45:11 -0700
commitca7376bb115e2d3506a3efe242bde25118f57c39 (patch)
tree512f4248a4b1a387f4b348bd02d2e70f6afe86d7 /libpod
parentfa0d3c564a0868e79d46d0bfbfea40a98456f2b4 (diff)
downloadpodman-ca7376bb115e2d3506a3efe242bde25118f57c39.tar.gz
podman-ca7376bb115e2d3506a3efe242bde25118f57c39.tar.bz2
podman-ca7376bb115e2d3506a3efe242bde25118f57c39.zip
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 <jhonce@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime.go4
1 files changed, 4 insertions, 0 deletions
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 {