# 信号

## 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:

\##Quit the server

```shell
nats-server --signal quit
```

## Stop the server

```shell
nats-server --signal stop
```

## Reopen log file for log rotation

```shell
nats-server --signal reopen
```

## Reload server configuration

```shell
nats-server --signal reload
```

## Lame duck mode server configuration

```shell
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:

```shell
nats-server --signal stop=<pid>
```

```shell
nats-server --signal stop=/path/to/pidfile
```

See the [Windows Service](/cn/yun-xing-yi-ge-nats-fu-wu/introduction/windows_srv.md) section for information on signaling the NATS server on Windows.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.natsclub.cn/cn/yun-xing-yi-ge-nats-fu-wu/nats_admin/signals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
