[comp.unix.questions] can SIGPWR signal really allow u to detect machine crash in Unix?

TAYBENGH%NUSDISCS.BITNET@cunyvm.cuny.edu (08/20/90)

        I am doing client and server distributed programming. I would like
to capture all the signals in Unix, particularly SIGPWR in order to inform
the other party about the failure. In this case, can SIGPWR can really be
caught in the program if there is power failure? If yes, normally how
much time is allowed for the SIGPWR signal handler to run and inform the
failure to the remote party?
        Please direct your response to me. I will summarize if there is
enough interest.
        Thanks.

- Beng Hang Tay (email: taybengh@nusdiscs)

decot@hpisod2.HP.COM (Dave Decot) (08/21/90)

>         I am doing client and server distributed programming. I would like
> to capture all the signals in Unix, particularly SIGPWR in order to inform
> the other party about the failure. In this case, can SIGPWR can really be
> caught in the program if there is power failure? If yes, normally how
> much time is allowed for the SIGPWR signal handler to run and inform the
> failure to the remote party?

The SIGPWR signal is sent to all processes *after the power has returned
and the system has recovered* from a power failure, instead of *prior to*
the power failure.

SIGPWR is not necessarily generated by all implementations that seem to
support that signal name.  In particular, those machines that do not recover
automatically from power failure obviously won't have any processes to
which to send the signal.

The point of SIGPWR is for applications that want to do something special
(such as reinitialization) when power returns and the system has automatically
recovered.

By default, SIGPWR is ignored.  After power is restored, processes not
catching SIGPWR will simply continue on as if nothing had happened,
since system memory and the time-of-day clock is backed up by a battery.

On HP-UX, the SIGPWR signal is generated by HP9000 Series 600 and 800
systems (that is, those with the PA-RISC architecture).

>> DISCLAIMER: These are my opinions only; I do not represent HP on notes. <<

Dave Decot