SHUTDOWN(8)

πŸ“¦
version 2.3.1 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

SHUTDOWN(8) πŸ’–

okay bestie, welcome to the GNU/Linux System Adminstrator's manual page for shutdown, and honestly? this one's a baddie. it's the little program that puts your whole system to sleep (or wakes it back up). let's get into it 🫢


✨ NAME ✨

shutdown, reboot, poweroff β€” poweroff or reboot the system πŸ’…


🌸 SYNOPSIS 🌸

/usr/sbin/shutdown [-h] [-r] [-f] [-F] [now]
/usr/sbin/reboot [-w] [-f] [-n]
/usr/sbin/halt [-w] [-f] [-n]
/usr/sbin/poweroff [-w] [-f] [-n]

look at her. four names, one icon πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

So Shutdown is a program to poweroff or reboot the system, and the whole point of it is that it maintains some compatibility with the original SysV-init halt, poweroff, reboot and shutdown programs. Why does that matter? Because some initscripts, graphical desktop environments and tools like acpi literally expect these programs to exist. it's giving "we keep the old friends around" πŸ’–

When it's called as shutdown, halt or poweroff with no options, runit(8) is told to shutdown the system and poweroff. bye bye ✨

When it's called as reboot, runit(8) is told to reboot the system. hi again πŸ‘‹

And when runit(8) is not the current init system, this program sends data in the appropriate format to perform the requested action to the initctl pipe, if it exists. flexible queen.


πŸŽ€ SHUTDOWN OPTIONS πŸŽ€

  • -h β€” Shutdown the system and poweroff; this is the default. Actually this option is ignored and can be omitted, it is maintained only for backward compatibility with Sysv's shutdown. (not me keeping an option around purely for the nostalgia 😭)
  • -r β€” Reboot the system instead of poweroff. πŸ”₯
  • -f β€” Write a /fastboot flag file. The program or the scripts responsible for the system boot task can test for this file when the system comes up again and decide to skip fsck. The program or the scripts that perform the boot task also need to take care of the removal of the flag file. (yes bestie, cleanup is your job, not hers πŸ’…)
  • -F β€” Write a /forcefsck flag file. The program or the scripts responsible for the system boot task can test for this file when the system comes up again and decide to run fsck with a 'force' flag. The program or the scripts that perform the boot task also need to take care of the removal of the flag file.
ngl the vibes here are "I will leave you a note, you deal with the rest" and honestly? iconic.

The original Sysv shutdown implementation required a time parameter for shutdown and allowed for an optional shutdown message. The runit shutdown program does not support extra arguments after the options; if a time parameter other than 'now' is given, shutdown will exit with an error. ⚠️

To retain compatibility with acpi, -H, -P flags and shutdown messages are ignored and shutdown will continue without errors (see #1087001). periodt, no drama 🌈


πŸ’œ HALT OPTIONS πŸ’œ

  • -f β€” Invoke sync(), then force an unsafe reboot or poweroff immediately without signaling the init system. This will likely result in an unclean shutdown and can cause data loss or corruption. 😭 When runit is init, this option is a No-Op and all other options are ignored. See #899246.
bestie. hear me. this one is lowkey dangerous. data loss is not a vibe. do not be casual with -f. πŸ’€
  • --force β€” Invoke sync(), then force an unsafe reboot or poweroff immediately without signaling the init system. This will likely result in an unclean shutdown and can cause data loss or corruption. This option works regardless of the running init system. (same chaos, but she shows up no matter what init you're running 🫢)
  • -w, --wtmp-only β€” Try to write a shutdown wtmp entry in wtmpdb(8) database; if /usr/bin/wtmpdb program is not found or not executable, a warning is printed instead.
  • -n β€” Write a /etc/runit/nosync flag file. If this file exists runit does not invoke sync() before reboot or poweroff. The /etc/runit/nosync flag file is also checked when this program is called with -f or --force.

Any other option given is ignored except that a warning is printed. πŸ‘€


🌟 SWITCHING FORM OTHER INIT SYSTEMS 🌟

(yes the section is called "FORM", we don't fix it, we respect her πŸ’–)

This program maintains a compatibility layer with SysV-init's initctl pipe according to the spec described in SysV-init's initctl(5). This allow one to reboot the system when switching from another init to runit-init.

Currently only switching from systemd and SysV-init is tested but any other init system that maintains an initctl pipe compatible with SysV's one should work. no cap ✨


πŸ’€ BUGS πŸ’€

Combining flags, like halt -wf is not supported, all merged short options will be ignored.

so don't try to be cute and smash them together, she will simply pretend you didn't πŸŽ€

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸ¦‹ written by the GNU/Linux System Adminstrator's manual girlies, dated August 30, 2022. go forth, reboot responsibly, and always signal your init system πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from