Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site nosccod.UUCP
Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!nosccod!martin
From: martin@nosccod.UUCP
Newsgroups: net.unix-wizards
Subject: Re: background processes under 4.2bsd
Message-ID: <341@nosccod.UUCP>
Date: Fri, 24-Feb-84 10:38:14 EST
Article-I.D.: nosccod.341
Posted: Fri Feb 24 10:38:14 1984
Date-Received: Sat, 25-Feb-84 15:47:03 EST
References: <989@druxy.UUCP>
Organization: Naval Ocean Systems Center
Lines: 10


     In most cases, it is an advantage that background processes are not
interrupted when the login shell dies.  One very simple way to kill a
background job at logout, is to pass the
process id of the parent shell (login shell) to the job as an argument.
E.g. run 'prog $$ &' where $argv[1] contains the process id of the parent.
If the background job doesn't have much to do, periodically check
to see if the parent process is still around, and if the background process is orphaned, kill it.
Having the background job monitor the status of the login process is
time consuming, but it works.
Doug Martin        martin@nosc