🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.misc
Article #575

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

#575
From: Brad Morrison
Date: Wed, 30 Aug 1989 21:54
22 lines
1413 bytes
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
Technical Details
Message-ID: <5933@ficc.uu.net>
Path: arc1-ca.pugleaf.net!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
References: <105@csnz.co.nz> <1989Aug26.200813.15629@twwells.com> <128@isgtec.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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