Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2012 09:59:13 GMT
From:      Gianpaolo Del Matto <delmatto@phunsites.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/164625: [PATH] port net-mgmt/icinga to support IDOUtils
Message-ID:  <201201300959.q0U9xDKp039122@red.freebsd.org>
Resent-Message-ID: <201201301000.q0UA0KSq037916@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164625
>Category:       ports
>Synopsis:       [PATH] port net-mgmt/icinga to support IDOUtils
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 30 10:00:20 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Gianpaolo Del Matto
>Release:        8.2-RELEASE
>Organization:
>Environment:
FreeBSD GPWS 8.2-RELEASE FreeBSD 8.2-RELEASE #7: Wed Feb 16 13:33:10 PST 2011     root@build8x64.pcbsd.org:/usr/obj/usr/pcbsd-build82/fbsd-source/8.2/sys/PCBSD  amd64

>Description:
Attached patch will add a new config option to the net-mgmt/icinga port, which adds this optional build arguments if selected:

WITH_MYSQL=client
LIB_DEPENDS+=           dbi.1:${PORTSDIR}/databases/libdbi-drivers
CONFIGURE_ARGS+=        --enable-idoutils
INSTALL_TARGET+=        install-idoutils
USE_RC_SUBR+=           ido2db

This will build icinga with support for IDOUtils.
It will also add an additional rc-script for ido2db to local base /etc/rc.d.

Actually, libdbi-drivers already has WITH_MYSQL as selectable dependency.
I added however WITH_MYSQL to the Icinga port as well, because building
libdbi-drivers with MYSQL deselected would make no sense.

As to my knowledge, Icinga would also support libdbi-drivers with PostgreSQL, but I didn't test that.

So the real dependency is:

Icinga -> libdbi-drivers -> with at least mysql or postgres (or both) enabled

While Icinga should make sure that either MySQL or PostgreSQL are available.

I'll be willing to implement this dependency correctly if my current approach would be wrong.
>How-To-Repeat:

>Fix:
see patch file attached, applies cleanly to current port snapshot (jan/30/2012)

Patch attached with submission follows:

--- Makefile.org	2012-01-28 16:36:46.000000000 +0000
+++ Makefile	2012-01-28 17:51:38.000000000 +0000
@@ -27,6 +27,7 @@
 		NANOSLEEP "Use nanosleep in event timing" off \
 		EVENT_BROKER "Enable event broker functionality" off \
 		UNHANDLED_HACK "Display passive checks in unhandled queries" off \
+		IDOUTILS "Enable IDOUtils [requires MySQL]" off \
 
 GNU_CONFIGURE=	yes
 
@@ -108,6 +109,14 @@
 CONFIGURE_ARGS+=	--disable-event-broker
 .endif
 
+.if defined(WITH_IDOUTILS)
+USE_MYSQL=		yes
+LIB_DEPENDS+=		dbi.1:${PORTSDIR}/databases/libdbi-drivers
+CONFIGURE_ARGS+=	--enable-idoutils
+INSTALL_TARGET+=	install-idoutils
+USE_RC_SUBR+=		ido2db
+.endif
+
 post-patch:
 .if defined(WITH_UNHANDLED_HACK)
 	@${REINPLACE_CMD} -e 's#;serviceprops=42\&#;serviceprops=10\&#g' \
--- /dev/null	2012-01-28 18:00:51.000000000 +0000
+++ files/ido2db.in	2012-01-28 18:00:30.000000000 +0000
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/net-mgmt/ido2db/files/ido2db.in,v 1.0 2012/01/28 17:35:01 gdelmatto Exp $
+#
+
+# PROVIDE: ido2db 
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable ido2db:
+# ido2db_enable (bool):    Set to "NO" by default.
+#                          Set it to "YES" to enable ido2db.
+#
+
+. /etc/rc.subr
+
+name="ido2db"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/bin/ido2db"
+command_args="-c"
+
+[ -z "${ido2db_enable}" ]       && ido2db_enable="NO"
+[ -z "${ido2db_configfile}" ]   && ido2db_configfile="%%PREFIX%%/etc/icinga/ido2db.cfg"
+
+load_rc_config "${name}"
+
+required_files="${ido2db_configfile}"
+command_args="${command_args} ${ido2db_configfile}"
+
+run_rc_command "$1"
--- files/pkg-message.in.org	2012-01-28 17:48:37.000000000 +0000
+++ files/pkg-message.in	2012-01-28 17:49:38.000000000 +0000
@@ -4,6 +4,10 @@
 
    icinga_enable="YES"
 
+ If installed, enable ido2db in /etc/rc.conf with the following line:
+
+   ido2db_enable="YES" 
+
  Configuration templates are available in %%PREFIX%%/etc/icinga as
  *.cfg-sample files.  Copy them to *.cfg files where required and
  edit to suit your needs.  Documentation is available in HTML form


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201300959.q0U9xDKp039122>