Powered By GitBook
Signals
On Unix systems, the NATS server responds to the following signals:
Signal
Result
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 -sl flag:
1
# Quit the server
2
nats-server --signal quit
3
4
# Stop the server
5
nats-server --signal stop
6
7
# Reopen log file for log rotation
8
nats-server --signal reopen
9
10
# Reload server configuration
11
nats-server --signal reload
12
13
# Lame duck mode server configuration
14
nats-server --signal ldm
Copied!
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:
1
nats-server --signal stop=<pid>
Copied!
1
nats-server --signal stop=/path/to/pidfile
Copied!
See the Windows Service section for information on signaling the NATS server on Windows.
Last modified 1mo ago
Export as PDF
Copy link