Skip to content

Conversation

@alexbozhenko
Copy link
Member

@alexbozhenko alexbozhenko commented Dec 15, 2025

Expand the help to make it obvious what is going on for each command, to remove the need to look up it in the docs or read the code

    -sl,--signal <command>[=<pid>]   Send a command to a running nats-server:
                                       ldm - lame duck mode: evicts clients gradually, then shuts down gracefully (SIGUSR2)
                                       quit - shuts down gracefully (SIGINT)
                                       term - shuts down gracefully (SIGTERM)
                                       stop - terminates immediately (SIGKILL)
                                       reload - reloads server configuration (SIGHUP)
                                       reopen - reopens log files (SIGUSR1)
                                     <pid> can be either a PID (e.g. 1) or the path to a PID file (e.g. /var/run/nats-server.pid)file (e.g. /var/run/nats-server.pid)

Signed-off-by: Alex Bozhenko [email protected]

Signed-off-by: Alex Bozhenko <[email protected]>
@alexbozhenko alexbozhenko requested a review from a team as a code owner December 15, 2025 21:27
Signed-off-by: Alex Bozhenko <[email protected]>
@sciascid
Copy link
Contributor

SIGINT and SIGTERM are handled sightly differently, see server/signal.go:

				case syscall.SIGINT:
					s.Shutdown()
					s.WaitForShutdown()
					os.Exit(0)
				case syscall.SIGTERM:
					// Shutdown unless graceful shutdown already in progress.
					s.mu.Lock()
					ldm := s.ldm
					s.mu.Unlock()

					if !ldm {
						s.Shutdown()
						s.WaitForShutdown()
						os.Exit(0)
					}

SIGTERM has the additional check for ldm.
Would it be worth highlighting this difference in the help message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants