how process in background can kill itself after logout (BSD unix).

mike at bria mike at bria
Wed Jan 30 07:04:24 AEST 1991


> 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 ..."



More information about the Comp.unix.programmer mailing list