SHUTDOWN(8)
π SHUTDOWN(8) β the dinit shutdown squad π
Ok so bestie, you've found the manual page for the shutdown utility that ships with the Dinit service manager package (Dinit - service management system, no cap). Also peep dinit(8) if you wanna know the whole lore, iykyk.
β¨ NAME β¨
dinit-shutdown, dinit-halt, dinit-poweroff, dinit-reboot, dinit-soft-reboot β literally the system shutdown girlies π
πΈ SYNOPSIS πΈ
dinit-shutdown [-r|-h|-p|-s] [--use-passed-cfd] [--system]
dinit-halt [options...]
dinit-poweroff [options...]
dinit-reboot [options...]
dinit-soft-reboot [options...]
π¦ DESCRIPTION π¦
So this manual page is all about the shutdown utility that comes with the Dinit service manager package. Go look at dinit(8) for the main character energy.
The dinit-shutdown, dinit-reboot, dinit-soft-reboot, dinit-poweroff and dinit-halt commands are how you tell the service manager daemon to do a service rollback and then shut the system down. They can also just do a shutdown straight-up, without any service rollback. Flexible queen π
Quick note for consistency with other packages: the dinit-halt and dinit-poweroff aliases exist, but ngl they have no special significance. The default action is to power down the system if it's called as any of dinit-shutdown, dinit-halt, or dinit-poweroff.
Some features only work on certain operating systems (and they need kernel support, so vibe check your kernel first π).
π OPTIONS π
--helpβ prints a brief lil help text and then dips. Bye π-rβ requests a shutdown followed by a restart π. This is the default if it's executed asdinit-reboot.-kβ shuts the system down and boots directly into a new kernel, without firmware reinitialisation. Bestie you must load a suitable kernel image first β go seekexec(8)for that.-sβ restarts the service manager and all user-space services without restarting the whole system. This is the default if it's executed asdinit-soft-reboot.
The current boot-time options get passed on to the restarted dinit and stay in effect (heads up: system recovery options, for example, may re-initiate the recovery process π). Services have to be suitably configured for this option to actually be useful, so using it in environments where it isn't specifically supported is not recommended, fr fr.
-hβ shutdown, then halt the system (no powering down) π.-pβ shutdown, then power down the system π. This is the default unless it's executed asdinit-rebootordinit-soft-reboot.--use-passed-cfdβ instead of trying to open a socket connection to the service daemon, it uses a pre-opened connection that got passed to the process from its parent via an open file descriptor. The file descriptor holding the connection is identified by the contents of theDINIT_CS_FDenvironment variable π.--systemβ shuts down directly, instead of by issuing a command to the service manager.
This option should be avoided π¨ β but it may let you perform a clean shutdown in the case where the service manager has stopped responding. Emergency vibes only.
The service manager may invoke dinit-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 these locations, it gets executed before the system shuts down but after terminating all other processes:
/etc/dinit/shutdown-hook/lib/dinit/shutdown-hook
Only the first existing executable file from that list gets executed, ok? The first location is meant for the system administrator to customise (and should usually be a script which, on completion, executes the 2nd shutdown hook if it's present). The 2nd location is intended for distribution control π
The script gets 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", same as for a regular reboot).
If it's 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 stops dinit-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.
So basically: exit 0 = "I handled the unmounting, bestie, stand down", exit nonzero = "you gotta do it yourself". Pick one and commit π
π SEE ALSO π
π AUTHOR π
Dinit, and this manual, were written by Davin McCall. Iconic behaviour honestly.
Dinit 0.21.0 Β· March 2026 Β· that's the whole page, ily, go reboot something responsibly πβ¨ππ¦
π¦ where this page comes from
- alpine 3.24: dinit-doc 0.21.0-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms