On Unix systems, the NATS server responds to the following signals:
Signal | Result |
| Kills the process immediately |
| Stops the server gracefully |
| Reopens the log file for log rotation |
| Reloads server configuration file |
| 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:
# Quit the servernats-server --signal quit​# Stop the servernats-server --signal stop​# Reopen log file for log rotationnats-server --signal reopen​# Reload server configurationnats-server --signal reload​# Lame duck mode server configurationnats-server --signal ldm
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/pidfile
See the Windows Service section for information on signaling the NATS server on Windows.