box.ctl.on_shutdown()
The box.ctl
submodule also contains two functions for the two
server trigger definitions: on_shutdown
and on_schema_init
.
Please, familiarize yourself with the mechanism of trigger functions before using them.
Details about trigger characteristics are in the triggers section.
-
box.ctl.
on_shutdown
(trigger-function[, old-trigger-function])¶ Create a “shutdown trigger”. The
trigger-function
will be executed whenever os.exit() happens, or when the server is shut down after receiving a SIGTERM or SIGINT or SIGHUP signal (but not after SIGSEGV or SIGABORT or any signal that causes immediate program termination).Parameters: - trigger-function (
function
) – function which will become the trigger function - old-trigger-function (
function
) – existing trigger function which will be replaced by trigger-function
Return: nil or function pointer
If the parameters are (nil, old-trigger-function), then the old trigger is deleted.
If you want to set a timeout for this trigger, use the set_on_shutdown_timeout function.
- trigger-function (