[Pkg-nagios-devel] nagios changelog,1.25,1.26 nagios-common.postinst,1.4,1.5

seanius@haydn.debian.org seanius@haydn.debian.org


Update of /cvsroot/pkg-nagios/nagios
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv29326

Modified Files:
	changelog nagios-common.postinst 
Log Message:
couple bugfixes, including the recent "serious" one.

now, should we wait for pre5 to make its way through,
or go ahead and upload this one?  also, what are thoughts
on removing the "pre" syntax in a version or two?


	sean



Index: changelog
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/changelog,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- changelog	7 Dec 2004 15:24:08 -0000	1.25
+++ changelog	9 Dec 2004 20:00:31 -0000	1.26
@@ -1,8 +1,15 @@
-nagios (2:1.3-0+pre6) unstable; urgency=low
+nagios (2:1.3-0+pre6) unstable; urgency=medium
 
   * Sean Finney:
     - another path fix, this time in obsessive_svc_handler.  thanks
       to Ragnar Wisloff <ragnar@skolelinux.no> (closes: #284472).
+    - don't freak out if the htpasswd file exists but doesn't have
+      a nagiosadmin account.
+    - fix for installs where nagios was configured via debconf to use
+      a combination of apache that no longer exists on the server.
+      thanks to Brian C. DeRocher <brian.derocher@mitretek.org>.
+      (closes: #284949).  upload priority set to medium, as it
+      fixes an RC bug.
 
  -- Sean Finney <seanius@debian.org>  Mon, 06 Dec 2004 18:22:51 -0500
 

Index: nagios-common.postinst
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.postinst,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- nagios-common.postinst	2 Dec 2004 02:43:55 -0000	1.4
+++ nagios-common.postinst	9 Dec 2004 20:00:32 -0000	1.5
@@ -59,19 +59,22 @@
 	else
 	    conf=httpd.conf
 	fi
-
-	if grep -qs "^Include /etc/nagios/apache.conf" /etc/$apache/$conf; then
-		mv -f /etc/$apache/$conf /etc/$apache/$conf.old.nagios
-		grep -v "^Include /etc/nagios/apache.conf" /etc/$apache/$conf.old.nagios \
-			> /etc/$apache/$conf
-	fi
-	if ! grep -qs "^Include /etc/$apache/conf.d" /etc/$apache/$conf; then
-		cp -f /etc/$apache/$conf /etc/$apache/$conf.old.nagios
-		echo "Include /etc/$apache/conf.d" >> /etc/$apache/$conf
-		mkdir -p /etc/$apache/$conf
-	fi
-	if [ -f /etc/$apache/$conf.old.nagios ]; then
-		mv -f /etc/$apache/$conf.old.nagios /etc/$apache/$conf.old
+	
+	# XXX this is a temporary hack, this all needs to be reworked
+	if [ -f "/etc/$apache/$conf" ]; then
+		if grep -qs "^Include /etc/nagios/apache.conf" /etc/$apache/$conf; then
+			mv -f /etc/$apache/$conf /etc/$apache/$conf.old.nagios
+			grep -v "^Include /etc/nagios/apache.conf" /etc/$apache/$conf.old.nagios \
+				> /etc/$apache/$conf
+		fi
+		if ! grep -qs "^Include /etc/$apache/conf.d" /etc/$apache/$conf; then
+			cp -f /etc/$apache/$conf /etc/$apache/$conf.old.nagios
+			echo "Include /etc/$apache/conf.d" >> /etc/$apache/$conf
+			mkdir -p /etc/$apache/$conf
+		fi
+		if [ -f /etc/$apache/$conf.old.nagios ]; then
+			mv -f /etc/$apache/$conf.old.nagios /etc/$apache/$conf.old
+		fi
 	fi
     done
 }
@@ -108,9 +111,6 @@
 	    elif [ ! -f /etc/nagios/htpasswd.users ] ; then
 		# The passwd file don't exists
 		$htpasswd -c -b /etc/nagios/htpasswd.users nagiosadmin "$RET"
-	    elif ! cat /etc/nagios/htpasswd.users | grep -q ^nagiosadmin; then
-		# File exists, but there's no nagiosadmin in there!?
-		$htpasswd -b /etc/nagios/htpasswd.users nagiosadmin "$RET"
 	    else
 		echo "Nagiosadmin already existing with password. To change the"
 		echo "password, please use the $htpasswd command."