ports/120150: [maintainer-update] net-mgmt/nagios: Link binaries against libthr(3) where available

Jarrod Sayers jarrod at netleader.com.au
Wed Jan 30 13:20:03 UTC 2008


>Number:         120150
>Category:       ports
>Synopsis:       [maintainer-update] net-mgmt/nagios: Link binaries against libthr(3) where available
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 30 13:20:01 UTC 2008
>Closed-Date:
>Last-Modified:
>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 at 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 at yahoo-inc.com>
+ dnl FreeBSD -pthread check - Jonathan McDowell <noodles at 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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list