[Nut-upsdev] Asking hard questions about the NUT architecture

Charles Lepple clepple at gmail.com
Wed May 30 02:02:57 UTC 2007


On 5/29/07, Eric S. Raymond <esr at thyrsus.com> wrote:
> Charles Lepple <clepple at gmail.com>:
> > Can you elaborate a little on how this SIGPWR shutdown works?
>
> Sure.  First, underlying hardware detects that power is going
> down. How this is done depends -- normally your motherboard has some
> sort of threshold detector that picks up on a voltage drop from the
> power supply and raises a hardware-level interrupt (often a pin assert
> on the processor).

Sounds good so far. (And yes, I have designed a few boards with
voltage supervisors before.)

> > Specifically, what sends the signal, and what happens when it is
> > received?
>
> Your kernel catches the hardware-level interrupt.  It shotguns SIGPWR
> at every process on the system. What happens then is dependent on
> whether there are explicit SIGPWR handlers in the apps; the default
> includes performing the equivalent of a sync on each file descriptor
> the process has open.

Which kernels do this?

I'm having a little trouble finding this in Linux (SGI excepted):

http://lxr.linux.no/ident?i=SIGPWR

I am not even going to bother booting up my FreeBSD machine to grep
for SIGPWR because as others have mentioned, USB on FreeBSD is far
from the state of reliability that I would associate with tasks like
shutting a computer down (false negatives as well as false positives).

You've raised a few good points about configuration, but a good
portion of NUT's current userbase probably isn't so cavalier about
trusting this idealistic shutdown case at the moment (however real it
may become in the future).

-- 
- Charles Lepple



More information about the Nut-upsdev mailing list