Signal Command
Use the--signal flag to send signals to a running NATS server process:
Signal Format
string
required
The signal to send. Available signals:
ldm, stop, quit, term, reopen, reloadstring
Process identifier. Can be either:
- A numeric PID (e.g.,
1234) - Path to a PID file (e.g.,
/var/run/nats-server.pid)
Available Signals
ldm - Log Debug and Memory
Dumps current goroutine stack traces and memory stats to the log. Usage:- Written to the configured log file (if
-lwas used) - Written to stdout if no log file configured
- Debugging deadlocks
- Investigating high memory usage
- Troubleshooting performance issues
stop - Graceful Shutdown
Initiates graceful shutdown of the server. The server will:- Stop accepting new connections
- Wait for existing clients to disconnect
- Flush pending messages
- Exit cleanly
SIGINT(Ctrl+C)SIGTERM
quit - Immediate Shutdown
Immediately terminates the server without graceful cleanup. Usage:SIGQUIT
term - Terminate
Similar tostop, initiates graceful shutdown.
Usage:
SIGTERM
reopen - Rotate Log File
Reopens the log file. Used for log rotation with external tools likelogrotate.
Usage:
- External tool moves/renames the current log file
- Send
reopensignal to nats-server - Server closes old file handle and opens new log file
reload - Reload Configuration
Reloads the server configuration from the config file without restarting. Usage:Logging settings
Logging settings
- Log level
- Debug/trace flags
- Log file path
Cluster settings
Cluster settings
- Cluster permissions
- Authorization
Monitoring settings
Monitoring settings
- HTTP monitoring port settings
- Listen address and port
- Server name
- Cluster URL
- JetStream storage directory
- TLS certificates (requires restart)
Using PID Files
For reliable signal delivery, start the server with a PID file:System Signal Equivalents
You can also send signals directly using standard Unix tools:Complete Examples
Production Server with Signal Support
Debug Running Server
Update Authorization
Emergency Shutdown
Systemd Integration
For systemd-managed servers, signals are handled automatically:Related Options
- Server Options - PID file configuration
- Logging Options - Log file and rotation settings