From reading documentation and other questions here, I see different examples for how to execute functions on SIGINT
, SIGTERM
, on calls to sys.exit()
, etc.
Is there any way to register a function to run on any kind of termination? "any kind" means:
- Regular exit using sys.exit() or when the flow ends
- An uncaught error that crashes the application
- External various killing signals