in reply to Re: Capturing a Browser Timeout Signal
in thread Capturing a Browser Timeout Signal

even if the script still runs, the script sometimes gets killed by the webserver, usually script ran as 'nobody' or started by the webserver will time out to keep resources in the clear. perhaps this is really what I should be asking. how do I capture when the server kills the process

 

-justin simoni
!skazat!

  • Comment on Re: Re: Capturing a Browser Timeout Signal

Replies are listed 'Best First'.
(bbfu) (sig suggestions) Re(2): Capturing a Browser Timeout Signal
by bbfu (Curate) on May 25, 2001 at 06:24 UTC

    Try trapping the following signals:

    HUP, INT, QUIT, KILL, TERM, STOP, ABRT

    One of those will probably do it but I'm not sure which.

    To trap a signal, use the following:

    $SIG{KILL} = sub { print "This is my signal handling code. Log messages here.\n"; };

    BTW, you can get a list (in the form of a single string separated by single spaces) of all the signals your system supports like this:

    use Config; print "$Config{sig_name}\n";

    HTH

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.

      You have forgotten PIPE which it most likely is.

        Hrm. I intentionally didn't include PIPE because I didn't think it would be that causing. Thinking about it now, though, I see that it could well be the cause. Mea culpa.

        bbfu
        Seasons don't fear The Reaper.
        Nor do the wind, the sun, and the rain.
        We can be like they are.

Re: Re: Re: Capturing a Browser Timeout Signal
by shotgunefx (Parson) on May 25, 2001 at 05:20 UTC
    Are you using Apache? My experience is that scripts will go on long after the connection is dropped.

    What type of run-time are you talking about? Minutes, Hours, Days?

    -Lee

    "To be civilized is to deny one's nature."