shutdown

Updated: April 19, 2023

Shut down and reboot the system (QNX Neutrino)

Note: You must be root to run this utility.

Syntax:

shutdown [-bcfkqvw] [-n nodename] [-S type]

Runs on:

QNX Neutrino

Options:

-b
Shut down but don't reboot. You can't use this option with -n nodename.
-c
Kill processes in the reverse of the order in which they were created (i.e., kill the newest one first).
-f
Shut down fast. Reduce the amount of time between sending a SIGTERM signal and a sending a SIGKILL to processes that catch SIGTERM.
-k
Shut down, and activate the kill switch. If there isn't a kill switch, then perform a system shutdown. This option might not be supported on all hardware.
-n nodename
Shut down the specified node (default is current node).
-q
Be quiet.
-S type
The type of shutdown, which must be one of:
  • system — shut down the system.
  • reboot — reboot the system.

The default is reboot.

-v
Be verbose.
-w
Do a warm reboot, if possible.

Description:

The shutdown utility performs an orderly system shutdown. In general terms, shutdown does the following for each process listed under /proc:

  1. It sends a SIGTERM signal to the process.
  2. (QNX Neutrino 6.6 or later) It sends a SIGCONT signal, in case the process was stopped.
  3. It waits for a period of time. If the SIGKILL_TIMEOUT environment variable is defined, its value is used as the number of milliseconds to wait. Otherwise, the time depends on the class of the application (reduced if you specify the -f option).
  4. It sends a SIGKILL signal to the process if it still exists.

It then reboots the system (unless you specified the -b option).

The interval between the SIGTERM and SIGKILL signals allows processes that have elected to catch the SIGTERM signal to perform any cleanup they need to do before the system is rebooted. The SIGCONT allows a stopped process to be terminated by the queued SIGTERM or the subsequent SIGKILL.

Note: This utility tries to shut down the processes in a reasonable—but generic—order. You might want to create your own utility that shuts down your system in a particular way.

Files:

/var/log/wtmp
If this file already exists, shutdown adds an entry to it before shutting down or rebooting the system.
Note: The shutdown utility doesn't create /var/log/wtmp if it doesn't already exist. This file can quickly become very big, which isn't good on an embedded system with limited resources.

Environment variables:

SIGKILL_TIMEOUT
If this environment variable is defined, its value is used as the number of milliseconds to wait before sending a SIGKILL signal to processes that haven't yet terminated.