Signals
Command Line
On Unix systems, the NATS server responds to the following signals:
SIGKILL
Kills the process immediately
SIGQUIT
Kills the process immediately and performs a core dump
SIGINT
Stops the server gracefully
SIGTERM
Stops the server gracefully
SIGUSR1
Reopens the log file for log rotation
SIGHUP
Reloads server configuration file
SIGUSR2
Stops the server after evicting all clients (lame duck mode)
The nats-server binary can be used to send these signals to running NATS servers using the --signal/-sl flag. It supports the following commands:
stop
SIGKILL
quit
SIGINT
term
SIGTERM
reopen
SIGUSR1
reload
SIGHUP
ldm
SIGUSR2
Quit the server
nats-server --signal quitStop the server
nats-server --signal stopLame duck mode the server
nats-server --signal ldmReopen log file for log rotation
nats-server --signal reopenReload server configuration
nats-server --signal reloadMultiple processes
If there are multiple nats-server processes running, or if pgrep isn't available, you must either specify a PID or the absolute path to a PID file:
nats-server --signal stop=<pid>nats-server --signal stop=/path/to/pidfileAs of NATS v2.10.0, a glob expression can be used to match one or more process IDs, such as:
nats-server --signal ldm=12*Windows
See the Windows Service section for information on signaling the NATS server on Windows.
Last updated
Was this helpful?