From owner-freebsd-current Fri Nov 19 9:54:33 1999 Delivered-To: freebsd-current@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id 1671E14D0A for ; Fri, 19 Nov 1999 09:54:25 -0800 (PST) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id MAA16006; Fri, 19 Nov 1999 12:54:25 -0500 (EST) (envelope-from luoqi) Date: Fri, 19 Nov 1999 12:54:25 -0500 (EST) From: Luoqi Chen Message-Id: <199911191754.MAA16006@lor.watermarkgroup.com> To: wollman@khavrinen.lcs.mit.edu Subject: Re: init runs with console as control terminal? Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Bug the authors to fix it? daemon(3) is provided for a reason! > > Here's my version of a simple daemonizing program.... Neither > TIOCNOTTY nor setpgid() is sufficient to detach from a terminal > session in a POSIX environment; setsid() is required. daemon(3) does > a nice job of encapsulating this along with the other more obvious > prerequisites. > Time for a daemon(1)? I'd like to have a more flexible approach towards closing of stdin/out/err, maybe something similar to what Matt did, or similar to nohup: close it iff it's a tty. -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message