1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
This commit is contained in:
Alberto Ricart
2019-05-16 10:35:38 -05:00
parent 033cfb44fe
commit e02ebdf16e
11 changed files with 341 additions and 77 deletions

View File

@@ -4,39 +4,39 @@ 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) |
| `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:
```sh
# Quit the server
nats-server -sl quit
nats-server --signal quit
# Stop the server
nats-server -sl stop
nats-server --signal stop
# Reopen log file for log rotation
nats-server -sl reopen
nats-server --signal reopen
# Reload server configuration
nats-server -sl reload
nats-server --signal reload
# Lame duck mode server configuration
nats-server -sl ldm
nats-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:
```sh
nats-server -sl stop=<pid>
nats-server --signal stop=<pid>
```
```sh
nats-server -sl stop=/path/to/pidfile
nats-server --signal stop=/path/to/pidfile
```
See the [Windows Service](windows_srv.md) section for information on signaling the NATS server on Windows.