Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jun 2001 22:53:11 +0900 (JST)
From:      sanewo@ba2.so-net.ne.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/27875: rplayd should use daemon(3)
Message-ID:  <200106041353.f54DrBV05597@ba2.so-net.ne.jp>

next in thread | raw e-mail | index | archive | help

>Number:         27875
>Category:       ports
>Synopsis:       invoked on boot, SIGHUP is delivered and rplayd exits
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 04 07:00:09 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Takanori Saneto
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
an individual
>Environment:
System: FreeBSD muse.sanewo 4.3-STABLE FreeBSD 4.3-STABLE #0: Wed May 23 13:45:14 JST 2001 sanewo@muse.sanewo:/export/usr.obj/usr/src/sys/MUSE i386


>Description:

rplayd-3.3.2 installed from ports.
When booting up the system, rplayd is invoked from rc.d and after a while,
it exits.
Using ktrace, it seems getting SIGHUP. (and it is normal for rplayd to exit when it gets SIGHUP)

>How-To-Repeat:

Just like as described above.

>Fix:

With the following patch, using daemon(3) instead of just fork()ing
seems solving this problem.
I don't know which combination of the arguments to daemon(3) will be
appropreate for rplayd.

--- rplayd/rplayd.c.orig	Sun Jun  3 11:15:22 2001
+++ rplayd/rplayd.c	Sun Jun  3 11:15:24 2001
@@ -421,10 +421,9 @@
     /* Fork */
     if (do_fork)
     {
-	int pid = fork();
-	if (pid != 0)
-	{
-	    exit(0);
+	if (daemon(1, 1) < 0) {
+	    report(REPORT_ERROR, "daemon: %s\n", sys_err_str(errno));
+	    done(1);
 	}
     }
 
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106041353.f54DrBV05597>