ports/81220: MAINTAINER UPDATE: net-mgmt/nagios
Blaz Zupan
blaz at si.FreeBSD.org
Wed May 18 20:40:05 UTC 2005
>Number: 81220
>Category: ports
>Synopsis: MAINTAINER UPDATE: net-mgmt/nagios
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Wed May 18 20:40:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Blaz Zupan
>Release: FreeBSD 4.10-RELEASE i386
>Organization:
>Environment:
System: FreeBSD titanic.medinet.si 4.10-RELEASE FreeBSD 4.10-RELEASE #1: Sun Jun 27 16:39:26 CEST 2004 root at bigbrother.amis.net:/usr/obj/usr/src/sys/TITANIC i386
>Description:
Check validity of configurations files in the startup script.
Submitted by: Artem Naluzhny <tut at nhamon.com.ua>
>How-To-Repeat:
>Fix:
diff -urN nagios.old/Makefile nagios/Makefile
--- nagios.old/Makefile Tue Apr 5 19:17:52 2005
+++ nagios/Makefile Wed May 18 22:27:53 2005
@@ -7,6 +7,7 @@
PORTNAME= nagios
PORTVERSION= 2.0.b3
+PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=nagios
diff -urN nagios.old/files/nagios.sh.tmpl nagios/files/nagios.sh.tmpl
--- nagios.old/files/nagios.sh.tmpl Mon Feb 14 22:52:42 2005
+++ nagios/files/nagios.sh.tmpl Wed May 18 22:27:33 2005
@@ -34,14 +34,30 @@
start_precmd=start_precmd
stop_postcmd=stop_postcmd
+restart_precmd=nagios_checkconfig
# set defaults
nagios_enable=${nagios_enable:-"NO"}
nagios_flags=${nagios_flags:-""}
+nagios_checkconfig()
+{
+ echo -n 'Performing sanity check on Nagios configuration: '
+ $NagiosBin -v $NagiosCfg > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo 'FAILED.'
+ echo "Use '$NagiosBin -v $NagiosCfg' command for details."
+ return 1
+ else
+ echo 'OK.'
+ fi
+}
+
start_precmd()
{
+ nagios_checkconfig; [ $? != 0 ] && return 1
+
su -m ${nagios_user} -c "touch ${NagiosVar}/nagios.log ${NagiosSav}"
rm -f ${NagiosCmd}
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list