How to send child signal when parent exits?

Benjamin G. Golding bgg at yarra.oz.au
Fri Feb 23 14:39:06 AEST 1990


In article <8948 at wiley.UUCP> david at wiley.UUCP (David Hull) writes:
> 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.

Why not reorganise the order of the programs?  If you make your comsat
replacement the login shell and have it fork and wait for an
interactive shell to exit before your program exits.  A timer could
interrupt the wait() to tell it when to check for new mail.  The wait()
needs to be in a while loop so that it will resume if it was
interrupted (on unixes without restartable system calls).

It sounds simpler anyway.

	Ben.



More information about the Comp.unix.wizards mailing list