S6-LINUX-INIT-SHUTDOWN(8)

NAME
s6-linux-init-shutdown - trigger the system shutdown procedure

SYNOPSIS
s6-linux-init-shutdown [-h [-H | -P] | -p | -r | -k] [-a] [-t] sec [-i] [-f | -F] time [message]
s6-linux-init-shutdown -c [message]

DESCRIPTION
s6-linux-init-shutdown triggers the system shutdown procedure. It is normally invoked as /sbin/shutdown.

If the -c option is present, a pending shutdown is cancelled.

Else, it plans the shutdown procedure at time time.

If a message argument has been given, message is broadcast to all logged in users ( as tracked by utmp).

shutdown exits 0. The shutdown procedure happens asynchronously.

The s6-linux-init-shutdown program conforms to the LSB-3.0.0 shutdown interface[1].

time must follow the following format: [now | [+]mins | hh:mm]

•   ‘now’ means: trigger the shutdown sequence immediately.

•   hh:mm means: absolute time. Trigger the shutdown sequence when the time hh:mm occurs. If that time has passed for the day, it will wait for the next day. hh must have 1 or 2 digits; mm must have 2 digits.

•   mins or +mins means: relative time. Trigger the shutdown sequence after mins minutes.

The s6-linux-init-shutdown binary is not meant to be called directly by administrators. Instead, after an s6-linux-init-maker(8) invocation, the bin/ subdirectory of the target will contain a shutdown symlink to s6-linux-init-shutdown. The bin/ subdirectory should be copied by the administrator into /sbin for full interface compatibility with sysvinit.

The -f and -F options are only accepted for compatibility. LSB says they are used to advise the system to skip or enforce a fsck(8) after rebooting. But they are only advisory, and for decades now systems have used other methods of evaluating whether they should perform filesystem checks, so these options are largely obsolete nowadays.

OPTIONS

-a  Access control. The shutdown sequence will only be launched if one of the users listed in /etc/shutdown.allow is currently logged in ( as tracked by utmp). /etc/shutdown.allow is a text file, one user per line, lines starting with ‘#’ are comments.

-t sec
    At the end of the shutdown sequence, when it's time to kill all processes, have a “grace time” period of sec seconds between the SIGTERM and the SIGKILL ( to allow processes receiving SIGTERM to exit cleanly). Default is 3 seconds.

-k  Warning only. message will be sent to all logged in users, but the shutdown sequence will not be triggered.

-h  At the end of the shutdown sequence, halt the system. The behaviour of this option may be altered with -H or -P.

-p  At the end of the shutdown sequence, power off the system. ( This option is provided as an extension, it is not required by the LSB interface.)

-r  At the end of the shutdown sequence, reboot the system.

-f  Ignored.

-F  Ignored.

-c  Cancel a planned shutdown ( i.e. cancel the effect of a previous call to shutdown with a time argument that was not ‘now’). This cannot be used to interrupt a shutdown sequence that has already started.

-H  This option can only be used in conjunction with -h. Ensures the system is halted, not powered off, at the end of the shutdown sequence. -Hh is equivalent to -h.

-P  This option can only be used in conjunction with -h. Ensures the system is powered off at the end of the shutdown sequence. -Ph is equivalent to -p.

-i  Interactive confirmation request. The command needs to be launched in a terminal, and will prompt the user to type the ( short) hostname of the machine to be shut down. On mismatch, the command will abort. The point is to avoid inadvertently rebooting a remote machine in an ssh session.

EXIT STATUS

0   Success.

100 Permanent error ( such as a misuse).

111 Temporary error ( such as a system call failure).

SEE ALSO
s6-linux-init-echo(1), s6-linux-init-overview(7), s6-linux-init-quickstart(7), s6-linux-init-why(7), s6-linux-init(8), s6-linux-init-hpr(8), s6-linux-init-logouthookd(8), s6-linux-init-maker(8), s6-linux-init-nuke(8), s6-linux-init-shutdownd(8), s6-linux-init-telinit(8), s6-linux-init-umountall(8)

[1] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/shutdown.html

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-linux-init/s6-linux-init-shutdown.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)