From owner-freebsd-ports Mon Jun 4 7: 0:14 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8733437B407 for ; Mon, 4 Jun 2001 07:00:10 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f54E0At03564; Mon, 4 Jun 2001 07:00:10 -0700 (PDT) (envelope-from gnats) Received: from mgate05.so-net.ne.jp (mgate05.so-net.ne.jp [210.139.254.152]) by hub.freebsd.org (Postfix) with ESMTP id CAA2337B403 for ; Mon, 4 Jun 2001 06:53:14 -0700 (PDT) (envelope-from sanewo@ba2.so-net.ne.jp) Received: from mail.ba2.so-net.ne.jp (mail.ba2.so-net.ne.jp [210.139.254.21]) by mgate05.so-net.ne.jp (8.8.8+3.0Wbeta9/3.6W01050922) with ESMTP id WAA03944 for ; Mon, 4 Jun 2001 22:53:13 +0900 (JST) Received: from ba2.so-net.ne.jp (pee4a14.tokynt01.ap.so-net.ne.jp [202.238.74.20]) by mail.ba2.so-net.ne.jp with ESMTP id f54DrCC13127 for ; Mon, 4 Jun 2001 22:53:12 +0900 (JST) Received: (from sanewo@localhost) by ba2.so-net.ne.jp (8.11.3/8.11.3) id f54DrBV05597; Mon, 4 Jun 2001 22:53:11 +0900 (JST) (envelope-from sanewo) Message-Id: <200106041353.f54DrBV05597@ba2.so-net.ne.jp> Date: Mon, 4 Jun 2001 22:53:11 +0900 (JST) From: sanewo@ba2.so-net.ne.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/27875: rplayd should use daemon(3) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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