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

Jarrod Sayers jarrod at netleader.com.au
Wed Jan 2 05:30:04 UTC 2008


>Number:         119246
>Category:       ports
>Synopsis:       [maintainer-update] net-mgmt/nagios-devel: Link binaries against libthr(3) where available
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 02 05:30:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Jarrod Sayers
>Release:        FreeBSD 6.3-RC2 i386
>Organization:
>Environment:
System: FreeBSD wallace.netleader.com.au 6.3-RC2 FreeBSD 6.3-RC2 #106: Sun Dec 30 13:11:57 CST 2007 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 will be ported to the Nagios 2.x stream shortly, pending positive
feedback from this patch.
>How-To-Repeat:
>Fix:
Downloadable diff from:
http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nagios-devel-3.0.r1-lthr.diff

--- net-mgmt-nagios-devel-3.0.r1-lthr.diff begins here ---
diff -ruN ports/net-mgmt/nagios-devel.orig/Makefile ports/net-mgmt/nagios-devel/Makefile
--- ports/net-mgmt/nagios-devel.orig/Makefile	2007-12-20 03:45:33.000000000 +1030
+++ ports/net-mgmt/nagios-devel/Makefile	2008-01-02 12:24:43.000000000 +1030
@@ -7,6 +7,7 @@
 
 PORTNAME=	nagios
 DISTVERSION=	3.0rc1
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	nagios
diff -ruN ports/net-mgmt/nagios-devel.orig/files/patch-configure.in ports/net-mgmt/nagios-devel/files/patch-configure.in
--- ports/net-mgmt/nagios-devel.orig/files/patch-configure.in	2007-12-13 21:43:44.000000000 +1030
+++ ports/net-mgmt/nagios-devel/files/patch-configure.in	2008-01-02 12:15:07.000000000 +1030
@@ -1,5 +1,5 @@
---- configure.in.orig	Thu Nov  1 04:05:38 2007
-+++ configure.in	Thu Nov  1 19:33:42 2007
+--- configure.in.orig	2007-12-18 04:21:51.000000000 +1030
++++ configure.in	2008-01-02 12:15:05.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="3.0b7"
-@@ -196,7 +195,7 @@
+ PKG_VERSION="3.0rc1"
+@@ -119,7 +118,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,[
+@@ -180,6 +187,7 @@
+ if test $have_pthreads = "no"; then
+ 	AC_PTHREAD_FREEBSD
+ fi
++fi
+ 
+ AC_SUBST(THREADLIBS)
+ 
+@@ -196,7 +204,7 @@
  AC_SUBST(nagios_grp)
  AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_USER,"$nagios_user")
  AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_GROUP,"$nagios_grp")
@@ -17,7 +41,7 @@
  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)
-@@ -520,9 +519,9 @@
+@@ -520,9 +528,9 @@
  fi
  
  dnl Try and locate glib
@@ -29,3 +53,13 @@
  AC_SUBST(GLIB_LIBS)
  if test x$GLIB_LIBS != x; then
  	AC_DEFINE_UNQUOTED(HAVE_GLIB)
+@@ -667,6 +675,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-devel-3.0.r1-lthr.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list