Checking for new mail (and killing bkgnd process on logout?)

Jonathan Corbet corbet at mead.uucp
Sat Sep 2 06:56:46 AEST 1989


bmw at isgtec.UUCP (Bruce Walker):

>However, if you do this on a Sun (f'rinstance), the process
>disconnects from your tty and continues running (inherited by root).
>You end up with dozens of the little buggers.
>
>My (slightly klugey) solution is to add a line to my .logout (csh):
>
>	/bin/kill -9 `ps x | awk '$5=="checkmail" {print $1}'`&
>
>Anyone know a better way?

How about if you add a line like:

	signal (SIGHUP, SIG_DFL);

toward the beginning of your main program?  That will cause the program
to die when the parent process does...


Jonathan Corbet
National Center for Atmospheric Research, Field Observing Facility
corbet at stout.ucar.edu



More information about the Comp.unix.wizards mailing list