mirror of
https://github.com/containers/podman.git
synced 2025-10-16 18:53:19 +08:00
Merge pull request #24082 from Luap99/netns-leak
Fix netns leak on container creation and exit code 1 on SIGTERM.
This commit is contained in:
@ -197,7 +197,13 @@ func (s *APIServer) Serve() error {
|
||||
s.setupPprof()
|
||||
|
||||
if err := shutdown.Register("service", func(sig os.Signal) error {
|
||||
return s.Shutdown(true)
|
||||
err := s.Shutdown(true)
|
||||
if err == nil {
|
||||
// For `systemctl stop podman.service` support, exit code should be 0
|
||||
// but only if we did indeed gracefully shutdown
|
||||
shutdown.SetExitCode(0)
|
||||
}
|
||||
return err
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user