Are there any good reasons for halting system without cutting power?

Are there any good reasons to halt a system without switching off power to the hardware? I mean using the halt command without using the -p switch.

I haven’t been able to find an answer on the Internet.


Solution 1:

Are there any good reasons to halt a system without switching off power to the hardware?

Yes. I might want to push its reset button and reboot it, instead of pushing its power button to turn off its power.

I mean using the halt command without using the -p switch.

In 4.2BSD, the halt command did not have a -p switch. This points towards the larger answer, here: Not all hardware works like a PC; even PCs haven't always worked the way that they do now.

It has not been (and still sometimes is not) the case that Central Processing Units have control over the power supply, or can fully reset the mainboard and peripherals to the same states as they have at power-on. On some systems, the second part of "shut down and power off" or "shut down and reset" was a physical action, taken by the operator pressing a (proper) power button or a reset button on the machine's front panel. No amount of command-line switches could achieve it. On the software side, the machine simply shut down and then spun in an infinite loop doing nothing. (Some machines would exit to a ROM monitor program.)

Modern BSDs note that their halt command's -p option only turns off power "if it can" (FreeBSD) and will not do so where "the system does not support software powerdown" (NetBSD). The SCO UNIX haltsys command (the System 5 equivalent for halt) also didn't have a -p option, and its manual page explains that it halts the system so that the operator can then, through other means, power it off or reboot it.

Nowadays, there are those who, like the systemd folk, maintain that the halt command is in fact obsolete. They would maintain that one really does not have to use the halt command at all and that it exists in systems "for compatibility only" (as the systemd manual pages have it). This rather renders the question of what options to give to it moot (systemctl halt not having a -p option).

It also demonstrates the position that we are now in that this command set has become so festooned with compatibility options that it allows people to give computers self-contradictory instructions like reboot --halt and poweroff --reboot. I noted this in the manual page for the nosh halt, fasthalt, reboot, fastboot, and poweroff commands. ☺

Further reading

  • halt. 1982-05-11. 4.2BSD manual.
  • haltsys. 2005-06-03. SCO OpenServer manual.
  • Jonathan de Boyne Pollard (2018). haltsys. nosh Guide. Softwares.
  • Jonathan de Boyne Pollard (2018). fastpowercycle. nosh Guide. Softwares.
  • Jonathan de Boyne Pollard (2018). shutdown. nosh Guide. Softwares.
  • Lennart Poettering (2013-10-07). halt. systemd manual pages. freedesktop.org.