1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
nats.docs/nats_server/signals.md
Alberto Ricart 8b8afcaabc wip
2019-05-15 10:14:16 -05:00

1.1 KiB

Process Signaling

On Unix systems, the NATS server responds to the following signals:

Signal Result
SIGKILL Kills the process immediately
SIGINT 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:

# Quit the server
nats-server -sl quit

# Stop the server
nats-server -sl stop

# Reopen log file for log rotation
nats-server -sl reopen

# Reload server configuration
nats-server -sl reload

# Lame duck mode server configuration
nats-server -sl 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 -sl stop=<pid>
nats-server -sl stop=/path/to/pidfile

See the Windows Service section for information on signaling the NATS server on Windows.