[
Table Of Contents
| Keyword Index
]
ns_atsignal(n) 4.99.2 "NaviServer Built-In Commands"
ns_atsignal - Server callbacks
TABLE OF CONTENTS
SYNOPSIS
DESCRIPTION
COMMANDS
EXAMPLES
SEE ALSO
KEYWORDS
These commands provide hooks for you to register your own procedures to
be called during the different stages of the server processes lifetime.
You can find out which callbacks are already registered with the
ns_info callbacks command.
- ns_atprestartup script ?args?
-
Pre-startup procs are called in FIFO order after the configuration file has been
parsed and all modules loaded, but before the driver starts listening for and
processing connections.
- ns_atstartup script ?args?
-
Startup procs are called in FIFO order just after the server is fully
initialised and is listening for and processing connections.
- ns_atsignal script ?args?
-
Signal procs are called in FIFO order whenever a HUP signal is received
by the server process.
- ns_atshutdown script ?args?
-
At-shutdown procs are called in LIFO order when the server performs a controlled
shutdown after all other subsystem have been stopped.
Orderly shutdown is attempted within shutdowntimeout seconds, as
specified in the configuration file. Tcl shutdown procs are called before C
shutdown tasks are waited on, so should be well behaved.
Do not attempt to use other sub-systems, such as the ns_job command.
- ns_atexit script ?args?
-
At-exit procs are called in LIFO order after all shutdown procs have been
called and the server process is ready to exit. The atexit procs are
basically the last code to run.
Log the accumulated cache statistics and reset whenever the server is signalled:
| |
ns_atsignal {
foreach cache [ns_cache_names] {
ns_log notice "cache\[$cache\]: [ns_cache_stats -reset -- $cache]"
}
}
|
ns_atclose , ns_info
callback , signal