From leres@ee.lbl.gov  Tue Sep 22 17:40:46 2009
Return-Path: <leres@ee.lbl.gov>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 394F0106568D
	for <freebsd-gnats-submit@freebsd.org>; Tue, 22 Sep 2009 17:40:46 +0000 (UTC)
	(envelope-from leres@ee.lbl.gov)
Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.2.202])
	by mx1.freebsd.org (Postfix) with ESMTP id 23EBF8FC1C
	for <freebsd-gnats-submit@freebsd.org>; Tue, 22 Sep 2009 17:40:46 +0000 (UTC)
Received: from [198.128.27.249] (duo.dhcp.lbnl.us [198.128.27.249])
	(authenticated bits=0)
	by fun.ee.lbl.gov (8.14.3/8.14.3) with ESMTP id n8MHMjuJ055517
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 22 Sep 2009 10:22:45 -0700 (PDT)
Message-Id: <4AB907E6.3060401@ee.lbl.gov>
Date: Tue, 22 Sep 2009 10:22:46 -0700
From: Craig Leres <leres@ee.lbl.gov>
To: freebsd-gnats-submit@freebsd.org
Subject: [PATCH] net/freeradius2: rc.d script should deal with non-forking
 daemon

>Number:         139064
>Category:       ports
>Synopsis:       [PATCH] net/freeradius2: rc.d script should deal with non-forking daemon
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 22 17:50:01 UTC 2009
>Closed-Date:    Sun Apr 11 11:58:35 UTC 2010
>Last-Modified:  Fri Oct  8 02:20:02 UTC 2010
>Originator:     Craig Leres
>Release:        FreeBSD 7.1-RELEASE i386
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
    FreeBSD monrad.lbl.gov 7.2-RELEASE FreeBSD 7.2-RELEASE #3: Fri Jun
26 16:34:37 PDT 2009
leres@fun.ee.lbl.gov:/usr/src/7.2-RELEASE/sys/i386/compile/LBLSMP  i386

>Description:
	If you start radiusd with the single server mode flag
	(-s) it does not fork. This means that if you need to use
	single server mode, the rc.d script doesn't exit, thus
        blocking the startup of other scripts in /usr/local/etc/rc.d.

>How-To-Repeat:
	radiusd_enable="YES"
	radiusd_flags="-s"

>Fix:
	Create an explicit radiusd_start() function; patch attached.





--------------030508060409040308060608
Content-Type: text/plain;
 name="radiusd.sh-patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="radiusd.sh-patch.txt"

--- files/radiusd.sh.in.virgin	2008-07-28 06:14:17.000000000 -0700
+++ files/radiusd.sh.in	2009-09-22 09:58:19.000000000 -0700
@@ -19,6 +19,8 @@
 
 command=%%PREFIX%%/sbin/radiusd
 
+start_cmd="radiusd_start"
+
 # In debug mode, radiusd doesn't create a pid file, so comment pidfile and
 # let rc.subr use a process check on procname (which defaults to command).
 #pidfile=/var/run/radiusd/radiusd.pid
@@ -37,6 +39,12 @@
 
 radiusd_enable=${radiusd_enable-"NO"}
 
+# Needs a custom start proc because -s suppresses fork'ing
+radiusd_start()
+{
+	echo 'Starting radiusd'
+	${command} ${radiusd_flags} &
+}
 
 radiusd_debug()
 {

--------------030508060409040308060608--
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Sep 22 17:50:12 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139064 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: david@wood2.org.uk
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/139064: [PATCH] net/freeradius2: rc.d script should deal with non-forking daemon
Date: Tue, 22 Sep 2009 17:50:09 UT

 Maintainer of net/freeradius2,
 
 Please note that PR ports/139064 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/139064
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: pgollucci@FreeBSD.org
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/139064 [PATCH] net/freeradius2: rc.d script should deal with non-forking
Date: Mon, 18 Jan 2010 02:26:48 -0500

 ping....
 
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Thu Mar 25 00:59:08 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139064 
State-Changed-From-To: feedback->closed 
State-Changed-By: wxs 
State-Changed-When: Sun Apr 11 11:58:33 UTC 2010 
State-Changed-Why:  
Fixed with the change in ports/144970. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139064 

From: Craig Leres <leres@ee.lbl.gov>
To: bug-followup@FreeBSD.org
Cc: Cedric Hui <chui@lbl.gov>
Subject: Re: ports/139064: [PATCH] net/freeradius2: rc.d script should deal
 with non-forking daemon
Date: Thu, 07 Oct 2010 19:17:23 -0700

 This is a multi-part message in MIME format.
 --------------060909010605030807080809
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 I recently learned about a more kosher way to to daemonize daemons that
 don't fork(): use daemon(8). Attached is a patch that makes this change
 (and also changes /etc/rc.subr to %%RC_SUBR%%).
 
 		Craig
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (FreeBSD)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iEYEARECAAYFAkyufzMACgkQWxlAhAje3JtWiACfbMuvql3TO7SOyUUXaqFg3k9z
 DkUAmgO2tFcXSby90soDcYinWgLJYwhs
 =o+fw
 -----END PGP SIGNATURE-----
 
 --------------060909010605030807080809
 Content-Type: text/plain;
  name="patch-files-radiusd.sh.in"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch-files-radiusd.sh.in"
 
 --- radiusd.sh.in.orig	2010-04-11 04:43:26.000000000 -0700
 +++ radiusd.sh.in	2010-10-07 19:11:07.000000000 -0700
 @@ -11,7 +11,7 @@
  # radiusd_enable="YES"
  #
  
 -. /etc/rc.subr
 +. %%RC_SUBR%%
  
  name=radiusd
  rcvar=`set_rcvar`
 @@ -19,6 +19,8 @@
  
  command=%%PREFIX%%/sbin/radiusd
  
 +start_cmd="radiusd_start"
 +
  # In debug mode, radiusd doesn't create a pid file, so comment pidfile and
  # let rc.subr use a process check on procname (which defaults to command).
  #pidfile=/var/run/radiusd/radiusd.pid
 @@ -37,7 +39,12 @@
  
  radiusd_enable=${radiusd_enable-"NO"}
  
 -command_args="&"
 +# Needs a custom start proc because -s suppresses fork'ing
 +radiusd_start()
 +{
 +	echo 'Starting radiusd'
 +	daemon ${command} ${radiusd_flags}
 +}
  
  radiusd_debug()
  {
 
 --------------060909010605030807080809
 Content-Type: application/octet-stream;
  name="patch-files-radiusd.sh.in.sig"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
  filename="patch-files-radiusd.sh.in.sig"
 
 iEYEABECAAYFAkyufzMACgkQWxlAhAje3JsePwCgit2B+ccttzHVm7RLJJpcEWJ63eMAoI7n
 osOZbtgsPqulmrA4OeIsFb40
 --------------060909010605030807080809--
>Unformatted:
 This is a multi-part message in MIME format.
 --------------030508060409040308060608
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 
