SHUTDOWN(8)

NAME
shutdown, halt, poweroff, reboot, soft-reboot - system shutdown

SYNOPSIS
shutdown [-r|-h|-p|-s] [--use-passed-cfd] [--system]
halt [options...]
poweroff [options...]
reboot [options...]
soft-reboot [options...]

DESCRIPTION
This manual page is for the shutdown utility included with the Dinit service manager package. See dinit(8).

The shutdown, reboot, soft-reboot, poweroff and halt commands can be used to instruct the service manager daemon to perform a service rollback and then to shutdown the system. They can also perform shutdown directly, without service rollback.

Note that for consistency with other packages "halt" and "poweroff" aliases are provided, however they have no special significance. The default action is to power down the system if called as any of "shutdown", "halt", or "poweroff".

Some features are available only on certain operating systems (and require kernel support).

OPTIONS

--help
    Display brief help text and then exit.

-r  Request a shutdown followed by restart. This is the default if executed as reboot.

-k  Shutdown the system and boot directly into a new kernel, without firmware reinitialisation. A suitable kernel image must be loaded first; see kexec(8).

-s  Restart the service manager and all user-space services without restarting the system. This is the default if executed as soft-reboot.

    The current boot-time options will be passed on to the restarted dinit and remain in effect (note that system recovery options, for example, may re-initiate the recovery process). Services must be suitably configured in order for this option to be useful; using this option in environments where it is not specifically supported is not recommended.

-h  Shutdown and then halt the system (without powering down).

-p  Shutdown and then power down the system. This is the default unless executed as reboot or soft-reboot.

--use-passed-cfd
    Instead of attempting to open a socket connection to the service daemon, use a pre-opened connection that has been passed to the process from its parent via an open file descriptor. The file descriptor with the connection is identified by the contents of the DINIT_CS_FD environment variable.

--system
    Shut down directly, instead of by issuing a command to the service manager. Use of this option should be avoided, but it may allow performing a clean shutdown in case the service manager has stopped responding.

    The service manager may invoke shutdown with this option in order to perform system shutdown after it has rolled back services.

SHUTDOWN HOOKS
To allow for special shutdown actions, if an executable file exists at any of the following locations, it will be executed before the system is shut down but after terminating all other processes:

    •   /etc/dinit/shutdown-hook

    •   /lib/dinit/shutdown-hook

Only the first existing executable file from the above list will be executed. The first location is intended to allow customisation by the system administrator (and should usually be a script which on completion executes the 2nd shutdown hook, if present). The 2nd location is intended for distribution control. The script will be passed a single argument, one of "poweroff", "halt", "reboot" or "soft" depending on the shutdown type (for kexec, if supported, the argument will be "reboot", as for a regular reboot).

If found and successfully executed, the shutdown hook should perform any special shutdown actions that depend on all processes being terminated. If the shutdown hook cleanly unmounts (or remounts as read-only) all file systems including the root file system, it should exit with status 0 (success), which will prevent shutdown from attempting to unmount file systems itself. If it does not unmount file systems, the script should exit with a status other than 0.

SEE ALSO
dinit(8), dinitctl(8)

AUTHOR
Dinit, and this manual, were written by Davin McCall.