Re: trap und killall

David Haller <[email protected]> Sat, 6 Mar 2010 20:14:31 +0100
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Hallo,

Am Sam, 06 Mär 2010, Sebastian Siebert schrieb:
[..]
><http://linux.die.net/man/7/signal>

Warum in der Ferne schweifen, wo 'man 7 signal' so nah?

[..]
>> lockfile="/dev/shm/myscript.lock"
>> 
>> trap "rm -f $lockfile" SIGKILL

Nicht portabel.

># es hätte wie folgt lauten müssen (9 = SIGKILL):
>trap "rm -f $lockfile" 9

Das bekommt man aber nicht per 'killall script'. UND ES KANN EH NICHT
ABGEFANGEN WERDEN!

trap "rm -f '$lockfile'" EXIT TERM INT HUP

"EXIT" ist das gesuchte, das gibt's beim regulären Beenden (z.B. durch
'exit 0' im script, oder auch wenn das Script per kill/killall mit
SIGTERM (15) beendet wird. 

-dnh

-- 
If Windows is the solution, can we please have the problem back?