[comp.unix.questions] signal trapping

darrenr@mullauna.cs.mu.OZ.AU (Darren REED) (09/10/90)

Hi, how do I go about detecting when a user quits a program by dropping their
connection via a network ?

Also, is it possible to write a signal handler for a SIGKILL which gets
executed when a SIGKILL is received but doesn't stop the impending death ?

any help would be appreciated, thanks..

darrenr@mullauna.cs.mu.oz.au

gwyn@smoke.BRL.MIL (Doug Gwyn) (09/10/90)

In article <5423@munnari.oz.au> darrenr@mullauna.cs.mu.OZ.AU (Darren REED) writes:
>Hi, how do I go about detecting when a user quits a program by dropping their
>connection via a network ?

If the networking support is any good, you should get a SIGHUP.

>Also, is it possible to write a signal handler for a SIGKILL which gets
>executed when a SIGKILL is received but doesn't stop the impending death ?

No, SIGKILL cannot be caught or ignored (as the manual says!)
SIGKILL is normally sent only as a last resort; SIGTERM is considered
a better way to try to kill a process.  SIGTERM can be caught.