Killing the correct process
Geoff Clare
gwc at root.co.uk
Fri Mar 2 02:22:49 AEST 1990
In article <5669 at star.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
>
>You're right again! I've posted another script to alt.sources, which does
>things your way (at last! :-), but having a few extras too.
Glad to hear you've seen the light (at last :-).
Your new script is the same as mine with one worthwhile addition and a
few rather less useful (IMHO) ones. Thanks for saving me the effort of
implementing my suggested method for tidying up the leftover sleep.
>)>Another plus of timeout 5.0: the signal is now a parameter too.
>)
>)Another unnecessary frill. SIGTERM is the right signal to use - that's
>)why it's the default for the "kill" command.
>
>Again I don't agree; first there's the generality, then there's the fact
>that SIGHUP is used to signal exceptions too, and lastly both SIGALRM and
>SIGXCPU seem normal to send on a *timeout*.
Sorry, all three signals you mention are not right for this purpose.
SIGHUP: you might want to do a "nohup timeout somecommand ... &"
SIGALRM: is not for "timing out" a process, it's for use by a process, e.g.
for timing out a system call or for sleeping. If the process is
using SIGALRM, all your "time out" will do is wake it up early.
SIGXCPU: is for limiting resource usage, and in any case is non-standard.
The phrase "time out" when applied to a process really means "terminate
before normal completion". When you want to *TERM*inate a process you use
SIG*TERM*. Need I say more?
--
Geoff Clare, UniSoft Limited, Saunderson House, Hayne Street, London EC1A 9HH
gwc at root.co.uk (Dumb mailers: ...!uunet!root.co.uk!gwc) Tel: +44-1-315-6600
(from 6th May 1990): +44-71-315-6600
More information about the Comp.unix.questions
mailing list