box.ctl.on_shutdown() | Tarantool


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).

  • trigger-function (function) – function which will become the trigger function
  • old-trigger-function (function) – existing trigger function which will be replaced by trigger-function

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.

Found what you were looking for?