s6-linux-init
Software
skarnet.org
The s6-linux-init-halt program
s6-linux-init-halt triggers the shutdown procedure in order to
halt the system; or, with the -f option, it performs an immediate
hard shutdown.
Interface
s6-linux-init-halt [ -h | -p | -r ] [ -d | -w ] [ -W ] [ -f ] [ -R tmpfsdir ]
- If the -f option is present, s6-linux-init-halt halts the system immediately.
- Else, it triggers the machine's shutdown procedure.
- It exits 0. The shutdown procedure happens asynchronously.
This interface follows the traditional sysvinit interface for the
halt, poweroff and reboot programs as close as possible.
Exit codes
- 0: shutdown procedure triggered.
- 100: wrong usage, or user does not have root privileges.
- 111: system call failed.
Options
- -h : halt. No matter the name of the command, it will order
a halt (i.e. the system will be shut down, but the power will remain up).
This is the default for s6-linux-init-halt.
- -p : poweroff. No matter the name of the command, it will order
a power off. This is the default for s6-linux-init-poweroff.
- -r : reboot. No matter the name of the command, it will order
a reboot. This is the default for s6-linux-init-reboot.
- -d : Do not write a wtmp shutdown entry.
- -w : Only write a wtmp shutdown entry; do not actually shut down
the system.
- -W : Do not send a wall message to users before shutting
down the system. Some other implementations of the halt, poweroff
and reboot commands use the --no-wall long option to achieve this.
- -f : force. The command will not trigger a clean shutdown
procedure; it will just sync the filesystems then tell the kernel to immediately
halt, poweroff or reboot. This should be the last step in the lifetime of the
machine.
- -R tmpfsdir : assume that the root-only
boot-time tmpfs has been mounted on tmpfsdir. Default is /run.
It is important to get this right, because the contact point with the
s6-linux-init-shutdownd daemon,
which manages the shutdown procedure, is located under this directory. The
halt, poweroff and reboot scripts created by a
s6-linux-init-maker invocation
automatically use the correct -R option.
Notes