How to send child signal when parent exits?

David Hull david at wiley.UUCP
Thu Feb 22 21:09:34 AEST 1990


I've written a replacement for biff/comsat that works even when the
mail spool directory is mounted over NFS and the mail is being delivered
on another machine.  It wakes up every minute and stats the user's mail
file to decide whether he has received any new mail.

The program should automatically die when the user logs out.  I'd like
it to receive a SIGHUP when its parent, the login shell, exits, but
haven't been able to make it work.  Aren't all the processes in the
same process group as the login supposed to receive a SIGHUP when it
exits?

The program works now by calling getppid right before it stats the file.
If the parent has exited, init has inherited the program and the ppid
is 1.  It works but seems inelegant.  Does anybody have any help?

-David
					---------------------------------------
					David Hull  TRW Inc.  Redondo Beach, CA
					     david%wiley.uucp at csvax.caltech.edu
						...!{uunet,cit-vax}!wiley!david



More information about the Comp.unix.wizards mailing list