Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!im4u!ut-sally!ut-ngp!infotel!pollux!bobkat!m5d From: m5d@bobkat.UUCP Newsgroups: comp.unix.wizards Subject: Re: how do I make a process release its terminal? Message-ID: <471@bobkat.UUCP> Date: Mon, 26-Jan-87 10:41:28 EST Article-I.D.: bobkat.471 Posted: Mon Jan 26 10:41:28 1987 Date-Received: Wed, 28-Jan-87 06:37:08 EST References: <453@vixie.UUCP> Reply-To: m5d@bobkat.UUCP (Mike McNally (dlsh)) Distribution: world Organization: Digital Lynx, Inc; Dallas, TX Lines: 35 In article <453@vixie.UUCP> paul@vixie.UUCP (Paul Vixie Esq) writes: >I have a program that forks itself and exits upon running -- its child >process runs as a daemon forever after. In 'ps aux', I notice that it >still shows my tty as its control terminal -- even if I log out and >back in. > >I see that syslogd, inetd, cron, and the rest do NOT show 'co' as their >control terminal; how do I make this happen for me? > >This is (more or less) BSD 4.2, and the program is setuid root. Thanks... >-- >Paul A. Vixie {ptsfa, qantel, crash, winfree}!vixie!paul >329 Noe Street dual!ptsfa!vixie!paul@ucbvax.Berkeley.EDU >San Francisco nike!ptsfa!vixie!paul@seismo.CSS.GOV >CA 94116 paul@vixie.UUCP (415) 864-7013 My guess is that the other daemons you mentioned are started in the "rc" command file. I think that "init" runs this with no standard file descriptors, or maybe with /dev/null. So far as I know, you can't get rid of the control terminal. You might try fiddling with the process group, although the shell will grab the tty back anyway. All this makes me wonder. I don't have source; all the stuff I know I've figured out through conjecture and the documentation. If I ask a question, and somebody who has source looks up the answer and posts it, will the Unix police come and gun us all down? -- **** **** **** At Digital Lynx, we're almost in Garland, but not quite **** **** **** Mike McNally Digital Lynx Inc. Software (not hardware) Person Dallas TX 75243 uucp: {texsun,killer,infotel}!pollux!bobkat!m5d (214) 238-7474