From jarrod@wallace.netleader.com.au  Wed Jan 30 13:11:10 2008
Return-Path: <jarrod@wallace.netleader.com.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DD3216A417
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 30 Jan 2008 13:11:10 +0000 (UTC)
	(envelope-from jarrod@wallace.netleader.com.au)
Received: from wallace.netleader.com.au (wallace.netleader.com.au [203.122.246.247])
	by mx1.freebsd.org (Postfix) with ESMTP id 6743813C45B
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 30 Jan 2008 13:11:08 +0000 (UTC)
	(envelope-from jarrod@wallace.netleader.com.au)
Received: from wallace.netleader.com.au (localhost [127.0.0.1])
	by wallace.netleader.com.au (8.14.2/8.14.2) with ESMTP id m0UDAwaL048938
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 30 Jan 2008 23:40:59 +1030 (CST)
	(envelope-from jarrod@wallace.netleader.com.au)
Received: (from jarrod@localhost)
	by wallace.netleader.com.au (8.14.2/8.14.2/Submit) id m0UDAwx2048937;
	Wed, 30 Jan 2008 23:40:58 +1030 (CST)
	(envelope-from jarrod)
Message-Id: <200801301310.m0UDAwx2048937@wallace.netleader.com.au>
Date: Wed, 30 Jan 2008 23:40:58 +1030 (CST)
From: Jarrod Sayers <jarrod@netleader.com.au>
Reply-To: Jarrod Sayers <jarrod@netleader.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [maintainer-update] net-mgmt/nagios: Link binaries against libthr(3) where available
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         120150
>Category:       ports
>Synopsis:       [maintainer-update] net-mgmt/nagios: Link binaries against libthr(3) where available
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 30 13:20:01 UTC 2008
>Closed-Date:    Mon Feb 04 19:58:38 UTC 2008
>Last-Modified:  Mon Feb  4 20:00:07 UTC 2008
>Originator:     Jarrod Sayers
>Release:        FreeBSD 6.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD wallace.netleader.com.au 6.3-RELEASE FreeBSD 6.3-RELEASE #108: Sun Jan 20 11:31:48 CST 2008 root@wallace.netleader.com.au:/usr/obj/usr/src/sys/WALLACE i386
>Description:
Many users have reported issues whereby a fork()'d Nagios process consumes 100%
of it's available CPU time.  Depending on system configurations this can have
detrimental side affects until the process is killed or the system restarted.

Users have been working around this by mapping out the use of libpthread(3) in
/etc/libmap.conf.  This patch should resolve this issue by compiling Nagios
binaries against the libthr(3) threading library where available removing the
need to map libpthread(3) out.

This patch is identical to that of net-mgmt/nagios-devel's recently committed
fix for the same issue.  Also bundled is the addition of libltdl as requested
by Tom Judge (tjudge # mintel.com).
>How-To-Repeat:
>Fix:
Downloadable diff from:
http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nagios-2.10-libthr.diff

--- net-mgmt-nagios-2.10-libthr.diff begins here ---
diff -ruN ports/net-mgmt/nagios.orig/Makefile ports/net-mgmt/nagios/Makefile
--- ports/net-mgmt/nagios.orig/Makefile	2007-12-13 21:43:43.000000000 +1030
+++ ports/net-mgmt/nagios/Makefile	2008-01-30 23:21:57.000000000 +1030
@@ -7,6 +7,7 @@
 
 PORTNAME=	nagios
 PORTVERSION=	2.10
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	nagios
@@ -20,7 +21,7 @@
 USE_GETOPT_LONG=	yes
 USE_ICONV=	yes
 USE_PERL5_BUILD=	yes
-USE_AUTOTOOLS=	autoconf:261
+USE_AUTOTOOLS=	autoconf:261 libltdl:15
 USE_RC_SUBR=	nagios.sh
 
 CONFLICTS=	nagios-[13].*
diff -ruN ports/net-mgmt/nagios.orig/files/patch-configure.in ports/net-mgmt/nagios/files/patch-configure.in
--- ports/net-mgmt/nagios.orig/files/patch-configure.in	2005-02-15 08:22:42.000000000 +1030
+++ ports/net-mgmt/nagios/files/patch-configure.in	2008-01-30 23:25:30.000000000 +1030
@@ -1,5 +1,5 @@
---- configure.in.orig	Thu Feb 10 02:00:10 2005
-+++ configure.in	Sat Feb 12 14:11:54 2005
+--- configure.in.orig	2007-10-22 00:09:51.000000000 +0930
++++ configure.in	2008-01-30 23:25:03.000000000 +1030
 @@ -6,7 +6,6 @@
  
  AC_INIT(base/nagios.c)
@@ -7,8 +7,32 @@
 -AC_PREFIX_DEFAULT(/usr/local/nagios)
  
  PKG_NAME=nagios
- PKG_VERSION="2.0b2"
-@@ -137,7 +136,7 @@
+ PKG_VERSION="2.10"
+@@ -60,7 +59,15 @@
+ dnl Test for pthreads support - taken from ICU FreeBSD Port configure script
+ THREADLIBS=""
+ have_pthreads="no"
++have_thr="no"
+ 
++dnl Prefer libthr(3) over libpthread(3) due to serious process hanging issues
++AC_CHECK_LIB(thr,pthread_create)
++if test $ac_cv_lib_thr_pthread_create = yes; then
++	THREADLIBS="-lthr"
++	have_pthreads="yes"
++	have_thr="yes"
++else
+ dnl FreeBSD: Try ports/linuxthreads first - Mammad Zadeh <mammad@yahoo-inc.com>
+ dnl FreeBSD -pthread check - Jonathan McDowell <noodles@earth.li>
+ AC_DEFUN(AC_PTHREAD_FREEBSD,[
+@@ -121,6 +128,7 @@
+ if test $have_pthreads = "no"; then
+ 	AC_PTHREAD_FREEBSD
+ fi
++fi
+ 
+ AC_SUBST(THREADLIBS)
+ 
+@@ -137,7 +145,7 @@
  AC_SUBST(nagios_grp)
  AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_USER,"$nagios_user")
  AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_GROUP,"$nagios_grp")
@@ -17,3 +41,13 @@
  AC_SUBST(INSTALL_OPTS)
  
  AC_ARG_WITH(command_user,--with-command-user=<user> sets user name for command access,command_user=$withval,command_user=$nagios_user)
+@@ -599,6 +607,9 @@
+ 
+ 	AC_DEFINE_UNQUOTED(EMBEDDEDPERL)
+ 	PERLLIBS="`perl -MExtUtils::Embed -e ldopts`" 
++	if test x$have_thr = xyes; then
++		PERLLIBS="`echo $PERLLIBS | sed 's#pthread #lthr #'`"
++	fi
+ 	PERLDIR="`perl -MConfig -e 'print $Config{installsitearch}'`" 
+ 	CFLAGS="${CFLAGS} `perl -MExtUtils::Embed -e ccopts`" 
+ 	USEPERL=yes
--- net-mgmt-nagios-2.10-libthr.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Wed Jan 30 14:38:53 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120150 
State-Changed-From-To: open->analyzed 
State-Changed-By: wxs 
State-Changed-When: Wed Jan 30 15:05:58 UTC 2008 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=120150 
State-Changed-From-To: analyzed->closed 
State-Changed-By: wxs 
State-Changed-When: Mon Feb 4 19:58:36 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/120150: commit references a PR
Date: Mon,  4 Feb 2008 19:57:30 +0000 (UTC)

 wxs         2008-02-04 19:57:24 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/nagios      Makefile 
     net-mgmt/nagios/files patch-configure.in 
   Log:
   Link with libthr when available.  This should fix the CPU consumption
   problem.
   
   PR:             ports/120150 ports/119766
   Submitted by:   jarrod@netleader.com.au bernd.kuhlen@wetteronline.de
   Approved by:    maintainer (implicit) garga (mentor)
   
   Revision  Changes    Path
   1.66      +2 -1      ports/net-mgmt/nagios/Makefile
   1.2       +38 -4     ports/net-mgmt/nagios/files/patch-configure.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
