[Pkg-nagios-devel] nagios nagios-text.postinst,NONE,1.1 README.mysql,1.2,1.3 changelog,1.37,1.38 nagios-common.dirs,1.2,1.3 nagios-common.postinst,1.8,1.9 nagios-common.postrm,1.5,1.6 update-nagios,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-serv25725

Modified Files:
	README.mysql changelog nagios-common.dirs 
	nagios-common.postinst nagios-common.postrm update-nagios 
Added Files:
	nagios-text.postinst 
Log Message:
lots and lots of bugfixes.  see the attached patch to the changelog
for details.  after i've tested the final product on one of my real
nagios servers i'll upload it.

	sean



--- NEW FILE: nagios-text.postinst ---
#! /bin/sh
# postinst script for nagios
#
# see: dh_installdeb(1)

set -e

case "$1" in
configure|upgrade)
	# make sure this file exists
	statusfile="/var/log/nagios/status.log"
	if [ ! -f "$statusfile" ]; then
		touch "$statusfile"
		chown nagios:www-data "$statusfile"
		chmod 644 "$statusfile"
	fi
;;
esac

#DEBHELPER#

Index: README.mysql
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/README.mysql,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- README.mysql	13 Nov 2004 23:56:19 -0000	1.2
+++ README.mysql	15 Feb 2005 22:17:38 -0000	1.3
@@ -47,7 +47,9 @@
 
 1) /etc/nagios/resource.cfg
 
-Uncomment and set the following lines:
+Uncomment and set the following lines to appropriate values, replacing
+"someuser" and "somedatabase" with "nagios", and "somepassword" with
+whatever password you chose in the above step:
 
 xsddb_database=nagios
 xsddb_username=nagios
@@ -83,3 +85,5 @@
 
 / This micro howto on how to set up Nagios for MySQL was provided
   by Jeff Bailey on the Debian GNU/Linux BTS (bug #163811).
+/ updated by sean finney 20050215 with some clarifications about
+  conf file defaults

Index: changelog
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/changelog,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- changelog	10 Feb 2005 15:34:15 -0000	1.37
+++ changelog	15 Feb 2005 22:17:38 -0000	1.38
@@ -1,3 +1,34 @@
+nagios (2:1.3-cvs.20050116-3) unstable; urgency=low
+
+  * Sean Finney:
+    - finally a fix for the absolute hrefs in side.html.  thanks to
+      Erik Rossen <rossen@prolibre.com> reporting this bug 203 days
+      ago (closes: #260914).
+    - README.pgsql already contains clarifications on the conf file
+      defaults for connecting to RDBMSes.  I updated README.mysql to be
+      more clear on this as well thanks to olaf for pointing out
+      the discrepancy a while back (closes: #282848).
+    - change permissions of update-nagios output to be readable by
+      group www-data, as it broke non-setuid cgi scripts.  thanks
+      to Joergen Haegg <jorgen.hagg@axis.com> for finding this
+      problem (closes: #292293).
+    - mkdir /etc/$apache/conf.d, not /etc/$apache/$conf in postinst.
+      d'oh.  actually, we shouldn't make that director at all in the
+      postscript, but list it as a directory in nagios-common.dirs.
+      Thanks to Pierre (didn't get his last name and he sent mail as root)
+      for this one (closes: #295345).
+    - make absolutely sure that /var/log/nagios/status.log is present
+      on the filesystem for nagios-text.  thanks to 
+      Tobias Krais <krais@bats.ch> for pointing this out (closes: #288914).
+    - clarification in the postinst message for when someone chooses
+      manual/no configuration of apache and htpasswd doesn't exist.
+      thanks to Jamie Wilkinson <jamie@anchor.net.au> (closes: #290243).
+    - added checks to prevent dpkg-statoverride from being called on
+      files already in the overrides database, and also removing files not
+      in the database.
+
+ -- Sean Finney <seanius@debian.org>  Thu, 10 Feb 2005 22:09:43 +0000
+
 nagios (2:1.3-cvs.20050116-2) unstable; urgency=low
 
   * Sean Finney:

Index: nagios-common.dirs
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.dirs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- nagios-common.dirs	9 Nov 2004 23:30:07 -0000	1.2
+++ nagios-common.dirs	15 Feb 2005 22:17:38 -0000	1.3
@@ -1,4 +1,5 @@
 etc/init.d
+etc/apache/conf.d
 etc/nagios/stylesheets
 usr/sbin
 usr/lib/nagios/plugins/eventhandlers

Index: nagios-common.postinst
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.postinst,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- nagios-common.postinst	9 Feb 2005 04:48:21 -0000	1.8
+++ nagios-common.postinst	15 Feb 2005 22:17:38 -0000	1.9
@@ -70,7 +70,6 @@
 		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
@@ -116,13 +115,17 @@
 		echo "password, please use the $htpasswd command."
 	    fi
 	else
-	    echo "There is no htpasswd command, so I can't create the password file"
-	    echo "for you. You will have to figure out a way to create a .htpasswd"
-	    echo "file yourself. When you do, it should be called:"
-	    echo "	/etc/nagios/htpasswd.users"
-	    echo "and be mode 0640, owned by root, group www-data."
-	    echo "	chown root:www-data /etc/nagios/htpasswd.users"
-	    echo "	chmod 0640 /etc/nagios/htpasswd.users"
+		cat <<EOF
+There is no htpasswd command, so I can't create the password file
+for you.  If you want to use nagios with apache You will have to figure
+out a way to create a htpasswd file yourself.  If you've chosen
+to configure apache (or some other web server) manually, you can safely
+disregard this.  Otherwise, the htpasswd file should be called:
+	/etc/nagios/htpasswd.users
+and be mode 0640, owned by root, group www-data.
+	chown root:www-data /etc/nagios/htpasswd.users
+	chmod 0640 /etc/nagios/htpasswd.users
+EOF
 	fi
 
 	db_get nagios/wwwsuid
@@ -130,13 +133,17 @@
 		chown nagios /usr/lib/cgi-bin/nagios/*cgi
 		chmod u+s /usr/lib/cgi-bin/nagios/*cgi
 		for f in /usr/lib/cgi-bin/nagios/*.cgi; do
-			dpkg-statoverride --add nagios root 4755 "$f"
+			if ! dpkg-statoverride --list "$f" >/dev/null; then
+				dpkg-statoverride --add nagios root 4755 "$f"
+			fi
 		done
 		perl -wpi -e 's[^check_external_commands=0][check_external_commands=1]' /etc/nagios/nagios.cfg
 	else
 		chmod u-s /usr/lib/cgi-bin/nagios/*cgi
 		for f in /usr/lib/cgi-bin/nagios/*.cgi; do
-			dpkg-statoverride --remove "$f"
+			if dpkg-statoverride --list "$f" >/dev/null; then
+				dpkg-statoverride --remove "$f"
+			fi
 		done
 		perl -wpi -e 's[^check_external_commands=1][check_external_commands=0]' /etc/nagios/nagios.cfg
 	fi

Index: nagios-common.postrm
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.postrm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- nagios-common.postrm	6 Feb 2005 00:12:58 -0000	1.5
+++ nagios-common.postrm	15 Feb 2005 22:17:39 -0000	1.6
@@ -40,7 +40,7 @@
 		rm -Rf {/var/cache,/var/run,/var/log,/etc}/nagios
 		# remove stat overrides
 		dpkg-statoverride --list '/usr/lib/cgi-bin/nagios/*.cgi' | \
-			cut -d' ' -f4 | xargs -n 1 dpkg-statoverride --remove 
+			cut -d' ' -f4 | xargs -r -n 1 dpkg-statoverride --remove 
 	else
 	    # Remove apache config if wanted.
 	    db_get nagios/configapache

Index: update-nagios
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/update-nagios,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- update-nagios	17 Nov 2004 23:30:08 -0000	1.4
+++ update-nagios	15 Feb 2005 22:17:39 -0000	1.5
@@ -33,7 +33,7 @@
 done
 
 mv -f $OUT $DEST
-chown nagios:nagios $DEST
+chown nagios:www-data $DEST
 
 if $FOUND_PLUGINS; then
 	if [ -x /etc/init.d/nagios -a "$1" != "--no-reload" ] ; then