[Pkg-sysvinit-devel] Bug#577146: Bug#577146: Is halt the correct action?

Henrique de Moraes Holschuh hmh at debian.org
Sat May 21 00:56:07 UTC 2011


On Thu, 19 May 2011, Elliott Mitchell wrote:
> I'm not suggesting you don't want to get the system down, I'm wondering
> whether "halt" versus "reboot" is the right target to have everything
> setup for.

I really don't understand what you want with all this.

Please write a proper chart of events of the situation you're worried about,
with an exact proposal of what you want changed.

Once you are past the point of no return, the system *WILL* shutdown (or, if
we wanted to cause data loss and changed that to a reboot, it WOULD reboot).
There is no switching to something else just because power was restored, or
the battery decided to malfunction, while the system was in the process of
shutting down (or rebooting).

And the point of no return is the exact moment you send INIT a signal to
switch to initiate a change to the halt or reboot runlevels.

> Two scenarios come to mind to ponder:
> Power fails, everything is on UPS power. UPS power gets down to a
> critical value, so the shutdown process starts. Moments later power

You are past the point of no return.  The system WILL shutdown, and
that's it.

> returns, but the shutdown process is already in progress. In this case,
> you're only going to be down for moments (just long enough for the UPS to
> charge some), and you've got something more akin to a reboot than a
> "halt".

No.  The system is going to be stuck in the shutdown sequence for a while
(let's hope a _small_ while), then it will be powered down UNTIL something
powers the system back up.

> Second case. Power fails, everything is on UPS power, but for the moment
> UPS power is holding. Just now though, a scheduled reboot occurs due to
> security patches or other condition. Moments after the reboot process has

Do not initiate such actions during emergency power, then.

> started, UPS power hits critical; suddenly you're set to be restarting,
> but by the time the UPS monitor is up and running there may no longer be
> enough battery to bring the system back down. Meanwhile, the scheduled
> shutdown might have been a good opportunity to shutdown the UPS anyway.

Either don't do that, or have enough time left in the UPS to last a lengthy
reboot + fsck + whatever + shutdown.

> I'm just pondering the situation, and ending up concluding runlevel 6 is
> the right one to use for this, not runlevel 0. I guess my mental model
> of "halt" is the system is going down for maintainance and won't be back
> up until a *human* turns power back on. Whereas my mental model of
> "reboot" is the system is going down "briefly" and will be back up as
> fast as hardware (length of time for firmware memory checks, or battery
> charge level) allows it to be.

There is absolutely nothing I can answer to this that will not be either
harsh.

This insanity ends here.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh





More information about the Pkg-sysvinit-devel mailing list