Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!murtoa.cs.mu.oz.au!ditmela!yarra!bgg From: bgg@yarra.oz.au (Benjamin G. Golding) Newsgroups: comp.unix.wizards Subject: Re: How to send child signal when parent exits? Message-ID: <1416@yarra.oz.au> Date: 23 Feb 90 03:39:06 GMT References: <8948@wiley.UUCP> Organization: Pyramid Technology Corp, Melb., Aust. Lines: 18 In article <8948@wiley.UUCP> david@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.