2

I have read some fascinating threads about the history and implementation of the halt and shutdown commands (and equivalents, eg. runlevels and systemctl targets) across different versions of Unix(-like) OSes/Linux over the past several decades, and it has been made abundantly clear that the purpose, use cases, and implementation of halt/shutdown and the relationship between the two has and still does vary from distribution to distribution.

Having said that, I have a very specific question: are there any current/modern practical use cases for (directly) using halt implementations that shut down the OS to a non-responsive/non-existent state (ie. not even a single-user shell) and leave the computer system itself powered on?

I'm asking because I would imagine most modern hardware would have a software mechanism for powering off, so I can't conceive of a need to halt an OS before manually powering off/restarting a system. (If I am wrong in saying "most", or if there is in fact a benefit to manually powering off/restarting a system with the OS terminated, please share.) I've also read that halt could be used for 'performing maintenance' on a computer system that is still powered on, but I haven't seen this point elaborated on - what kind of 'maintenance' could be done (and would be beneficial to do) on a powered-on computer system that doesn't have an OS (or any other software interface like BIOS) running?

For reference, these are the more useful threads I've read on the halt vs shutdown discussion, though they haven't really discussed modern uses for halt implementations that shutdown the OS without powering off the system:

3
  • On PC hardware, the admin/user may want to get console access to BIOS settings, and stopping the OS without powering off the whole server allows that access. (it may not be the only way to adjust BIOS settings, depending on the computer) Linux is often used on older/slower hardware that may not have the software facilities you envision.
    – Sotto Voce
    Dec 27, 2022 at 22:50
  • 1
    @SottoVoce Usually you get access to BIOS settings by rebooting the system, not by halting. Unless the system includes a hardware watchdog that triggers a reset when the system has been non-responsive for too long, halting a system specifically does not place the system back to firmware control, which would be a requirement to accessing the BIOS settings.
    – telcoM
    Dec 28, 2022 at 7:14
  • 1
    The BIOS access is an option I also use rarely. Background is, that some servers need some minutes to shutdown, and I don't want to sit in front and wait until the reboot kicks in (this is mostly the exact moment when I'm distracted and miss the BIOS entry. Also in this case firmwares like iKVM stay initialized.
    – stoney
    Dec 29, 2022 at 6:25

1 Answer 1

3

The uses for halting a system without either a reboot or poweroff immediately afterwards have always been very few indeed. It basically exists because there used to be (and still is) systems that cannot control their power electronically, but require the administrator to operate a physical power-off switch.

One of the only scenarios I could imagine is if you have a system that has been running continuously for years and you need to do some sort of maintenance to it, but don't dare to let its disks spin down as they might not be able to start up again. Halting the system would stop any data processing and might allow e.g. safe disconnection of some cables, while the disks might keep spinning.

A long time ago, back in the Linux kernel 2.2/2.4 era, someone noticed that the kernel's firewall implementation (iptables or one of its predecessors) kept working even while the system was halted. That might be useful as an extreme case of minimizing the attack surface on a firewall system: with the userspace halted, there would be no easy way to tamper with the firewall configuration and very limited ways to attack the firewall otherwise. Unfortunately, since modern kernels will most likely place the processors in a low-power halted state when halting the system, this trick will most likely not work any longer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .