Xref: utzoo comp.mail.misc:2323 comp.unix.xenix:7373 Path: utzoo!utgpu!watmath!att!dptg!rutgers!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!nuchat!sugar!ficc!morrison From: morrison@ficc.uu.net (Brad Morrison) Newsgroups: comp.mail.misc,comp.unix.xenix Subject: Re: Checking for new mail (and killing bkgnd process on logout?) Summary: Fork off! Know when to hang up...(hang up...hang up...hang up...) Message-ID: <5933@ficc.uu.net> Date: 30 Aug 89 21:54:41 GMT References: <105@csnz.co.nz> <1989Aug26.200813.15629@twwells.com> <128@isgtec.UUCP> Organization: {xe,u}nix Support Lines: 22 In article <128@isgtec.UUCP>, bmw@isgtec.UUCP (Bruce Walker) writes: > You are supposed to start it like this (usually from .login): > $ checkmail& > 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? At the beginning of your program, use signal() (Read The Fine Manual) to trap SIGHUP. Also, you could fork() before the main control loop, so the program will go into the background by itself. Newsgroup comp.unix.wizards removed from distribution. -- Brad Morrison (713) 274-5449 | "If it doesn't come from you, Ferranti International Controls Corporation | shouldn't it come from Gerber?" uunet!ficc!morrison morrison@ficc.uu.net | -- Bristol Meyers baby formula ad