From: Ashley Sheridan on
Hi all,

Bit of a curve ball here (at least I couldn't find anything on Google
yet) but I need a way to be able to detect if a particular php script
crashes and generate some form of report from it.

Here is the system setup:

CentOS system, with the PHP scripts running as CLI called from a bash
script as part of a daemon. The setup is already all in-place for an
existing system, I've just been asked to implement a crash detection
system.

I know I can monitor the error logs with tail() to detect errors, but
that is likely not going to be the main issue which needs tracking.

I've found a bit of documentation online for pcntl_signal() which I
believe should do the trick, but I can't seem to find just a plain old
list of signal monikers and their meanings. Does anyone have any light
to shed on this?

Also, any other input/suggestions would be more than welcome.

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Ashley Sheridan on
On Fri, 2010-07-02 at 11:51 +0100, Ashley Sheridan wrote:

> Hi all,
>
> Bit of a curve ball here (at least I couldn't find anything on Google
> yet) but I need a way to be able to detect if a particular php script
> crashes and generate some form of report from it.
>
> Here is the system setup:
>
> CentOS system, with the PHP scripts running as CLI called from a bash
> script as part of a daemon. The setup is already all in-place for an
> existing system, I've just been asked to implement a crash detection
> system.
>
> I know I can monitor the error logs with tail() to detect errors, but
> that is likely not going to be the main issue which needs tracking.
>
> I've found a bit of documentation online for pcntl_signal() which I
> believe should do the trick, but I can't seem to find just a plain old
> list of signal monikers and their meanings. Does anyone have any light
> to shed on this?
>
> Also, any other input/suggestions would be more than welcome.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>


I think I've managed to answer my own question now. I found a list of
system codes at http://www.php.net/manual/en/pcntl.constants.php but
with no accompanying descriptions of what each one means (and quite
frankly they all look foreign to me for what they're worth!)

However, Wikipedia to the rescue, http://en.wikipedia.org/wiki/SIGILL
(and all the other signal pages it has - links at the bottom of that
one) it has a good list of the codes used by Unix systems and even the
Linux only ones which are just synonyms for the Unix ones.

Hopefully, that's useful to someone else who had a similar problem!

Thanks,
Ash
http://www.ashleysheridan.co.uk