Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.unix-wizards Subject: Re: Conventional daemons Message-ID: <328@hadron.UUCP> Date: Sat, 22-Mar-86 12:15:52 EST Article-I.D.: hadron.328 Posted: Sat Mar 22 12:15:52 1986 Date-Received: Tue, 25-Mar-86 03:25:27 EST References: <261@bu-cs.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 19 Summary: Yes, change "/" to "/dev/null". In article <261@bu-cs.UUCP> ccc@bu-cs.UUCP (Cameron Carson) writes: > int s; > for (s = 0; s < SOME_NUM; s++) > (void) close(s); > (void) open("/",0); > (void) dup2(0,1); > (void) dup2(0,2); >My question is: why open "/" ? Why not open something a little >less vital like, say, /dev/null? For what it's worth, this is exactly what I have done for every daemon I have had to write or fix. However, "if it ain't broke, don't fix it." Oh, I do freopen stdout as /dev/console, often. I hope you meant "/dev/tty" instead of "dev/tty" later on. Also, a setpgrp() is usually part of this disassociation process. -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}