SHUTDOWN(8)

πŸ“¦ version 0.22.0, in nixos 26.05

πŸ’… 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 as reboot. πŸ”
  • -k β€” shuts the system down and boots directly into a new kernel, without firmware reinitialisation. a suitable kernel image must be loaded first; go see kexec(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 as soft-reboot. like, 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. 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 as reboot or soft-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 the DINIT_CS_FD environment 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