Path: utzoo!attcan!uunet!mcsun!ukc!stc!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.unix.questions Subject: Re: Killing the correct process Summary: which signal to use? Message-ID: <1813@root44.co.uk> Date: 1 Mar 90 15:22:49 GMT References: <22332@adm.BRL.MIL> <5312@star.cs.vu.nl> <1212@root44.co.uk> <5352@star.cs.vu.nl> <1221@root44.co.uk> <5448@star.cs.vu.nl> <1381@root44.co.uk> <5669@star.cs.vu.nl> Reply-To: gwc@root.co.uk (Geoff Clare) Organization: UniSoft Ltd, London, England Lines: 37 In article <5669@star.cs.vu.nl> maart@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@root.co.uk (Dumb mailers: ...!uunet!root.co.uk!gwc) Tel: +44-1-315-6600 (from 6th May 1990): +44-71-315-6600