Re:signal processing INT or TERM
- From: pangj@xxxxxxxxxxx (Jeff Pang)
- Date: Thu, 30 Oct 2008 15:20:37 +0100 (CET)
Message du 30/10/08 10:45
De : "icarus"
A : beginners@xxxxxxxx
Copie à :
Objet : signal processing INT or TERM
perl 5.8.2
OS: AIX fully POSIX compliant
my script moves files from one dir to another.
When I want my script to stop, should I pass it along the signal INT
or TERM?
INT just interrupts the script. It finishes whatever it's processing
and then it's done.
TERM on the other hand, just sends a TERMination signal, waits a few
seconds, then KILLs the program. TERM is more common I guess when
starting/stopping unix shell scripts in the init dir.
My fear is that if I pass the TERM signal, maybe the system will chop
off the files that are being moved on the fly. The "few seconds" are
unpredictable in value at least on my system. So the system might say
'it's been too long, let's kill it."
Any thoughts? Is there a "perlish" way to do it?
SIGTERM and SIGINT are almost the same usage. See 'man 8 kill' and look for signals.
You may want to redefine the POSIX signal handlers.
See also L. Stein's "Network programming with Perl", that will give the full details.
Jeff.
http://home.arcor.de/pangj/
Créez votre adresse électronique prenom.nom@xxxxxxxxxxx
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
- Prev by Date: RE: Hi all
- Next by Date: How to put a global variable in a package, accessible to users of that package?
- Previous by thread: Re: signal processing INT or TERM
- Next by thread: Hi all
- Index(es):
Relevant Pages
|