Bug 139064 - [PATCH] net/freeradius2: rc.d script should deal with non-forking daemon
Summary: [PATCH] net/freeradius2: rc.d script should deal with non-forking daemon
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Wesley Shields
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-22 18:50 UTC by Craig Leres
Modified: 2010-10-08 03:20 UTC (History)
0 users

See Also:


Attachments
patch-files-radiusd.sh.in (748 bytes, text/plain)
2010-10-08 03:17 UTC, Craig Leres
no flags Details
patch-files-radiusd.sh.in.sig (72 bytes, application/octet-stream)
2010-10-08 03:17 UTC, Craig Leres
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer 2009-09-22 18:50:01 UTC
	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.

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"



--------------030508060409040308060608----QGSRF04XxtXq3gGqMqr0AyjLy5bb4i0ALM3deFmsZr94InA9
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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()
 {
How-To-Repeat: 	radiusd_enable="YES"
	radiusd_flags="-s"
Comment 1 Edwin Groothuis freebsd_committer 2009-09-22 18:50:09 UTC
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
Comment 2 Edwin Groothuis freebsd_committer 2009-09-22 18:50:12 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Philip M. Gollucci freebsd_committer 2010-01-18 07:26:48 UTC
ping....
Comment 4 Wesley Shields freebsd_committer 2010-03-25 00:59:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wxs

I'll take it.
Comment 5 Wesley Shields freebsd_committer 2010-04-11 12:58:33 UTC
State Changed
From-To: feedback->closed

Fixed with the change in ports/144970. Thanks!
Comment 6 Craig Leres freebsd_committer 2010-10-08 03:17:23 UTC
-----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-----