Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bria!mike From: mike@bria Newsgroups: comp.unix.programmer Subject: Re: how process in background can kill itself after logout (BSD unix). Message-ID: <405@bria> Date: 29 Jan 91 20:04:24 GMT References: <1991Jan29.012702.7265@nntp-server.caltech.edu> Organization: Briareus Corporation, Los Angeles, CA Lines: 20 > I would like to be able for a process I have running in the > background to kill itself after I logout. I am using BSD unix > in a Sun Sparcserver 490. Because a bug in the OS the process > keep writing to the terminal after I logout. Any help will > be appreciated. Are you ignoring SIGHUP? If you are, then change it so that the default action is taken (SIG_DFL), which is to croak the process. If you don't wan't the process to cleanup first, then trap the SIGHUP signal, and die gracefully. If you want the process to die of it's own accord sometime later, then trap SIGHUP to do a setpgrp() and freopen() stdin, stdout, and stderr (this will disassociate it from your terminal). Hope this helps. -- Michael Stefanik, Systems Engineer (JOAT), Briareus Corporation UUCP: ...!uunet!bria!mike -- technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly found to be saying things like "Well, it works on my DOS machine ..."