Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.mail.elm Subject: Re: newmail also displays on console (bug) Message-ID: <117@titania.warwick.ac.uk> Date: 6 Mar 89 21:29:00 GMT References: <316@wubios.wustl.edu> <890001@hpausla.HP.COM> <5142@b-tech.ann-arbor.mi.us> <4774@pbhyf.PacBell.COM> <2918@epimass.EPI.COM> Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 34 In article <2918@epimass.EPI.COM> jbuck@epimass.EPI.COM (Joe Buck) writes: >In article <4774@pbhyf.PacBell.COM> rob@pbhyf.PacBell.COM (Rob$Bernardo) writes: >>Newmail already obeys SIGHUP. This particular user's environment is such that >>the SIGHUP is not being sent to newmail and that's the problem. > >This particular user's environment is quite common: under the Bourne shell, >background processes don't ingnore hangup unless you use the "nohup" command, >but under the C shell they do by default. No, this is the wrong problem, Rob Bernado was correct. When you log out (at least Berkeley) Unix sends a SIGHUP to the process group of the terminal. With the Bourne shell this means all processes run from that shell, because it does no process group manipulation. The C-Shell, however, puts each `job' in it's own process group, so that the shell can manipulate who's allowed to talk to the terminal. It does not cause SIGHUPs to be ignored when you background a job, it's just that the jobs never get a SIGHUP, because they're not in the process group of the terminal. Presumably other shells with job control must do the same. >One solution is to define AUTO_BACKGROUND and have people run newmail without >doing ampersands. Right. >Another is to explicitly catch SIGHUP instead of keeping the default behavior, >which, as you say, depends on the environment. No, the process never gets a SIGHUP. Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England