SHUTDOWN(8)
π SHUTDOWN(8) β like, the whole Dinit shutdown situation π«Ά
okay so bestie, quick vibe check: this is the manual page for the shutdown utility that ships with the Dinit service manager package. it's part of the Dinit family (that's dinit(8) if you wanna go peek π), Dinit - service management system, and honestly? it's giving "one command, five personalities." β¨
πΈ NAME πΈ
shutdown, halt, poweroff, reboot, soft-reboot β system shutdown, aka the whole "bye girlie" moment for your machine π
π SYNOPSIS π
shutdown [-r|-h|-p|-s] [--use-passed-cfd] [--system]
halt [options...]
poweroff [options...]
reboot [options...]
soft-reboot [options...]
like, it's the same command wearing different outfits. slay. π
π¦ DESCRIPTION π¦
Okay so first things first: this manual page is for the shutdown utility included in the Dinit service manager package. see dinit(8) for the main character. π
The shutdown, reboot, soft-reboot, poweroff and halt commands can be used to tell the service manager daemon to do a service rollback and then shut the system down. and yes, they can also do the shutdown themselves, directly, without any service rollback β lowkey two modes, one icon. β¨
Quick note ngl: for consistency with other packages, the halt and poweroff aliases are provided, but honestly they have no special significance. no extra lore, no secret powers. the default action is to power down the system if it's called as any of shutdown, halt, or poweroff. periodt.
Some features? only available on certain operating systems (and they need kernel support). so like, check your OS is invited to the party first ποΈ
β¨ OPTIONS β¨
here's the whole menu, bestie. every single one. no skips. π
--helpβ prints a brief help text and then dips.<italic>exit stage left</italic>π¬-rβ requests a shutdown followed by a restart. this is the default if it's executed asreboot. π-kβ shuts the system down and boots directly into a new kernel, without firmware reinitialisation. a suitable kernel image must be loaded first; go seekexec(8). kernel parkour, no reboot in between π₯-sβ restarts the service manager and all user-space services without restarting the system. this is the default if it's executed assoft-reboot. like, the current boot-time options will be passed on to the restarteddinitand remain in effect β note that system recovery options, for example, may re-initiate the recovery process. also, services must be suitably configured for this option to actually be useful, and using this option in environments where it isn't specifically supported is not recommended. so like, know before you go π-hβ shutdown and then halt the system (without powering down). machine goes sleepy, not dead π€-pβ shutdown and then power down the system. this is the default unless it's executed asrebootorsoft-reboot. πͺ«--use-passed-cfdβ instead of trying to open a socket connection to the service daemon, it uses a pre-opened connection that has been passed to the process from its parent via an open file descriptor. the file descriptor carrying the connection is identified by the contents of theDINIT_CS_FDenvironment variable. very "my mom packed it for me" energy π--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. so it's the emergency exit, not the front door π
also fun fact: the service manager may invoke shutdown with this option in order to perform system shutdown after it has rolled back services. iykyk π«Ά
π§ SHUTDOWN HOOKS π§
so to allow for special shutdown actions, if an executable file exists at any of these 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 that list gets executed. no double-dipping, bestie. β
the first location is there so the system administrator can customise stuff (and it 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 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. and here's the important bit π
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. but if it does not unmount file systems, the script should exit with a status other than 0. so like, exit codes are genuinely communicating here, no cap π
π SEE ALSO π
dinit(8), dinitctl(8) β go read your siblings' pages bestie, they're iconic too π
π AUTHOR π
Dinit, and this manual, were written by Davin McCall. king behavior, honestly π
and that's the whole page!! πΈ ty for reading, you're literally so good at Unix now π«Ά β this was Dinit 0.22.0, dated May 2026. mwah π
π¦ where this page comes from
- nixos 26.05: dinit 0.22.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms