NaviServer Programmable Web Server

ns_shutdown(n)

NaviServer Built-in Commands – 5.1.0


[ Main Table Of Contents | Table Of Contents | Keyword Index ]

Name

ns_shutdown - Shut down NaviServer

Table Of Contents

Synopsis

Description

This command shuts down the server, optionally waiting for active connections and background jobs to finish.

When timeout is specified, it defines the maximum time to wait before the server proceeds with shutdown. The value must be greater than or equal to 0.

When timeout is omitted, NaviServer uses the configured default from the shutdowntimeout parameter in the ns/parameters section. The built-in default is 20s.

 ns_section ns/parameters {
    ns_param shutdowntimeout 20s
 }

If the timeout expires before all active work has completed, the server continues with immediate shutdown.

COMMANDS

ns_shutdown ?-restart? ?--? ?timeout?

This command shuts down the server, optionally waiting timeout for active connections and background jobs to finish. When the timeout expires, the server continues with immediate shutdown.

If timeout is omitted, the default is taken from the shutdowntimeout parameter in the ns/parameters section. The built-in default is 20s. When specified, timeout must be greater than or equal to 0.

-restart send an interrupt signal to the server, leading to a nonzero exit code.

EXAMPLES

 ns_shutdown
 ns_shutdown 30s

See Also

admin-config-params, ns_atsignal, ns_kill, ns_time

Keywords

restart, server built-in, shutdown, signals