SIGINT is what I needed to trap for this purpose. SIGKILL may be an
overkill !
Thanks all for the guidance.
__________________________________________
Ranga Nathan / CSG
Systems Programmer - Specialist; Technical Services;
BAX Global Inc. Irvine-California
Tel: 714-442-7591 Fax: 714-442-2840
David
Cantrell
<[EMAIL PROTECTED] To
ll.org.uk> Ranga Nathan
<[EMAIL PROTECTED]>
cc
08/26/2005 [email protected]
03:58 AM Subject
Re: [Boston.pm] Signal handling
On Thu, Aug 25, 2005 at 11:10:37PM +0000, Ranga Nathan wrote:
> I need to remember the last record processed no matter how a script
> completes - kill or stop.
You can't capture SIGKILL.
> My perl is a little rusty now. The following coding does not seem to
work.
>
> $SIG{KILL} = $SIG{STOP} = $SIG{TERM} = $SIG{__DIE__} = sub { system
("echo
> $last_rec > /tmp/ftpscan");die "Now I am stopping";};
>
> When I kill my script with Ctrl-C, I do not see the output of the "die".
>
> What am I doing wrong?
Not capturing SIGINT.
If you really need to cope with the effects of a SIGKILL, then you need
to do a bit more work. Go and read about how RDBMSes guarantee
consistency. Once you've worked around the effects of SIGKILL, then you
have, of course, no need for the other signal handlers.
--
David Cantrell | top google result for "internet beard fetish club"
Blessed are the pessimists, for they test their backups
-- anon
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm