From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Mar 25 18:40:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E46901065736 for ; Wed, 25 Mar 2009 18:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BDB248FC0A for ; Wed, 25 Mar 2009 18:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PIe1sl017481 for ; Wed, 25 Mar 2009 18:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n2PIe1mI017480; Wed, 25 Mar 2009 18:40:01 GMT (envelope-from gnats) Resent-Date: Wed, 25 Mar 2009 18:40:01 GMT Resent-Message-Id: <200903251840.n2PIe1mI017480@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, L Campbell Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CBFC10657D6 for ; Wed, 25 Mar 2009 18:31:43 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 670248FC17 for ; Wed, 25 Mar 2009 18:31:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PIVf54014756 for ; Wed, 25 Mar 2009 18:31:41 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n2PIVf7w014755; Wed, 25 Mar 2009 18:31:41 GMT (envelope-from nobody) Message-Id: <200903251831.n2PIVf7w014755@www.freebsd.org> Date: Wed, 25 Mar 2009 18:31:41 GMT From: L Campbell To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/133069: [patch] net-mgmt/nagios-plugins doesn't configure properly in jail X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2009 18:40:03 -0000 >Number: 133069 >Category: ports >Synopsis: [patch] net-mgmt/nagios-plugins doesn't configure properly in jail >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Mar 25 18:40:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: L Campbell >Release: 7.1 >Organization: >Environment: FreeBSD souseiseki.desudesudesu.org 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 14:37:25 UTC 2009 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: I'm running Nagios in a jail and ran into the issue described in this thread from December -- http://www.mail-archive.com/freebsd-jail@freebsd.org/msg00638.html The gist of it is that the Nagios plugin configure script goes through an exhaustive list of ping command options looking for one that works. The problem is they're testing each style by pinging the localhost, 127.0.0.1. In a jailed environment, that IP address may or may not be visible: root@jail-nagios> ping -n -c 1 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes ping: sendto: Can't assign requested address This causes their configure script to not be able to find the ping command. This failure causes PING_COMMAND to be defined as "" (which is a case their code doesn't check for) and smashes the stack whenever you try to run the binary. With the attached patch applied, the check_ping binary works as expected when built from within a jail (rather than emitting "not enough args" and segfaulting): root@jail-nagios> ./check_ping 10.0.0.5 -w 3000.0,80% -c 5000.0,100% PING OK - Packet loss = 0%, RTA = 0.03 ms|rta=0.028000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0 >How-To-Repeat: >Fix: Patch attached with submission follows: --- Makefile.orig 2009-02-26 12:04:16.000000000 +0000 +++ Makefile 2009-02-26 12:24:36.000000000 +0000 @@ -38,6 +38,8 @@ NAGIOSWWWDIR?= www/nagios NAGIOSHTMURL?= /nagios NAGIOSCGIURL?= ${NAGIOSHTMURL}/cgi-bin +NAGIOSPINGCMD?= '/sbin/ping -n -s 56 -t %d -c %d %s' +NAGIOSPING6CMD?= '/sbin/ping6 -n -s 56 -t %d -c %d %s' .include @@ -49,7 +51,9 @@ --datadir=${PREFIX}/share \ --sysconfdir=${PREFIX}/etc/nagios \ --localstatedir=${NAGIOSDIR} \ - --prefix=${PREFIX} + --prefix=${PREFIX} \ + --with-ping-command=${NAGIOSPINGCMD} \ + --with-ping6-command=${NAGIOSPING6CMD} CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \ CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ >Release-Note: >Audit-Trail: >Unformatted: