Date: Mon, 04 Jun 2001 14:03:42 +1000 From: Gregory Bond <gnb@itga.com.au> To: stable@freebsd.org Subject: Re: Who's HUPing my daemon? Message-ID: <200106040403.OAA28199@lightning.itga.com.au> In-Reply-To: Your message of Fri, 01 Jun 2001 22:20:52 %2B1000.
next in thread | raw e-mail | index | archive | help
Thanks to all, especially Phil Homewood who explained what is happening. Basically, init does the following fork() open /dev/console as STDIN/STDOUT/STDERR setsid() exec /etc/rc and when the rc scrip ends, noone has /dev/console open so it is closed and all processes with this as the controlling terminal get SIGHUP'd. The fix is to use the daemon() call to background and disassociate from the controlling terminal. I have patched the bpalogin client and this fixes the problem, and I have sent a patch to the program maintainer. Other options would include running bpalogin under nohup in the rc.d script (cute, and works for programs without source code!) and using fork()+setsid() rather than daemon() (for better portability to Linux/Solaris etc). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106040403.OAA28199>