[uClibc]daemons terminating

Bjorn Andersson bjorn at storsvangen.mine.nu
Wed Oct 30 19:30:43 UTC 2002


I have upgraded my embedded box with everything freshly built, including 
a much newer kernel (2.4.18).
Now I can't reproduce the problem, so it seems like I've been wasting 
your time.
Sorry about that!

/Bjorn

Erik Andersen wrote:

>On Tue Oct 29, 2002 at 08:37:35PM +0100, Bjorn Andersson wrote:
>  
>
>>I'm having problems with the daemon-function on a 48 Mhz motorola 860.
>>It seems like parent process terminates before the child process has had 
>>time
>>to become session leader. Am I the only one with this problem?
>>If a apply following patch everything works,
>>    
>>
>
>That sounds pretty wierd.  There should be no such race.
>    <sound of Erik thinking>
>
>Can you try this patch and let me know if it helps?
>
>--- libc/unistd/daemon.c	11 Jan 2002 13:30:41 -0000	1.6
>+++ libc/unistd/daemon.c	30 Oct 2002 08:27:53 -0000
>@@ -48,6 +48,11 @@
> 	if (setsid() == -1)
> 		return(-1);
> 
>+	/* Make certain we are not a session leader, or else we
>+	 * might reacquire a controlling terminal */
>+	if (fork())
>+		_exit(0);
>+
> 	if (!nochdir)
> 		chdir("/");
>
> -Erik
>
>--
>Erik B. Andersen             http://codepoet-consulting.com/
>--This message was written using 73% post-consumer electrons--
>  
>






More information about the uClibc mailing list