From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Mar 19 13:40:19 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6ABBF16A420 for ; Sun, 19 Mar 2006 13:40:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD84A43D49 for ; Sun, 19 Mar 2006 13:40:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k2JDeIiE088687 for ; Sun, 19 Mar 2006 13:40:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k2JDeIf1088686; Sun, 19 Mar 2006 13:40:18 GMT (envelope-from gnats) Resent-Date: Sun, 19 Mar 2006 13:40:18 GMT Resent-Message-Id: <200603191340.k2JDeIf1088686@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Jarrod O'Flaherty" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9A3F16A401 for ; Sun, 19 Mar 2006 13:39:58 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 744F343D48 for ; Sun, 19 Mar 2006 13:39:58 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k2JDdwxt066985 for ; Sun, 19 Mar 2006 13:39:58 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k2JDdwoM066981; Sun, 19 Mar 2006 13:39:58 GMT (envelope-from nobody) Message-Id: <200603191339.k2JDdwoM066981@www.freebsd.org> Date: Sun, 19 Mar 2006 13:39:58 GMT From: "Jarrod O'Flaherty" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/94690: [PATCH] Daemons in /usr/local/etc/rc.d/ must do "setssid()" call X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Mar 2006 13:40:19 -0000 >Number: 94690 >Category: ports >Synopsis: [PATCH] Daemons in /usr/local/etc/rc.d/ must do "setssid()" call >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 19 13:40:18 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Jarrod O'Flaherty >Release: 6.0-RELEASE >Organization: www.happyatjamos.com >Environment: FreeBSD toshiba.happyatjamos.com 6.0-RELEASE FreeBSD 6.0-RELEASE #6: Tue Jan 3 12:16:16 JST 2006 root@toshiba.happyatjamos.com:/usr/obj/usr/src/sys/GENERIC i386 >Description: It seems that daemons installed into /usr/local/etc/rc.d require a setsid() call in their startup code or they cannot be auto-started using the /etc/rc.conf file. This was the case with the printing daemon "ekpd" in /ports/print/pips730, which I installed for my EPSON ink jet. Although the daemon can be run fine manually, it would not start when I placed the following in my /etc/rc.conf file: > ekpd_enable="YES" > ekpd_flags="" Trace statements showed that the daemon was terminating at the end of FreeBDD's startup, right before the login prompt appeared. Kind Regards, Jarrod. >How-To-Repeat: I would suggest that other daemons which do not call setsid() (or daemon()) after their fork() will also be killed of at the end of startup. To verify this try installing /usr/ports/print/pips730 and adding the above ekpd_enable line to your rc.conf. You should find that the daemon is killed immediately before the login prompt appears after FreeBSD has completed booting. >Fix: The following patch to the file: /usr/ports/print/pips730/work/pips730-2.5.2/ekpd/cbtd.c fixes the problem. --- cbtd.c.orig Fri Nov 26 15:47:04 2004 +++ cbtd.c Sun Mar 19 13:42:30 2006 @@ -98,6 +98,9 @@ perror ("fork() failtd"); return 1; } + + setsid(); + #endif cbtd_control (); ---end diff--- >Release-Note: >Audit-Trail: >Unformatted: