Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!bu-cs!ccc From: ccc@bu-cs.UUCP (Cameron Carson) Newsgroups: net.unix-wizards Subject: Conventional daemons Message-ID: <261@bu-cs.UUCP> Date: Fri, 14-Mar-86 14:53:59 EST Article-I.D.: bu-cs.261 Posted: Fri Mar 14 14:53:59 1986 Date-Received: Sat, 15-Mar-86 22:48:51 EST Organization: Boston Univ Comp. Sci. Lines: 29 [] After an exhaustive examination of the code of the standard daemons (well, I sort of glanced at rwhod and ftpd), I noticed that the convention for disassociating the now-forked daemon from it's control terminal seems to be something on the order: int s; for (s = 0; s < SOME_NUM; s++) (void) close(s); (void) open("/",0); (void) dup2(0,1); (void) dup2(0,2); s = open("dev/tty", 2); if (s >= 0) { ioctl(s, TIOCNOTTY, 0); (void) close(s); } My question is: why open "/" ? Why not open something a little less vital like, say, /dev/null? -- Cameron C. Carson Distributed Systems Group Boston University ACC UUCP: ...!{harvard,allegra}!bu-cs!ccc ARPA: ccc%bu-cs@csnet-relay.arpa