[Pkg-nagios-devel] nagios nagios-common.nagios.init,1.3,1.4 nagios-common.postinst,1.6,1.7 nagios-common.postrm,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-serv28317
Modified Files:
nagios-common.nagios.init nagios-common.postinst
nagios-common.postrm
Log Message:
hey folks,
a couple minor changes, and one bugfix.
- echo -n "Restarting $DESC: "
$0 stop
sleep 2
$0 start
this previously did
Restarting nagios: Stopping nagios: nagios.
Starting nagios: nagios
so now it says:
Stopping nagios: nagios.
Starting nagios: nagios.
totally superficial, i know...
chown should use ":" as a seperator instead of "." given the recent
discussions on d-d. whoops, looks like there are a couple more that
i missed. i'll get those in another commit.
the rest are related to the suidness of cgi's being forgotten due
to dpkg-statoverride never being called to override the perms.
sean
Index: nagios-common.nagios.init
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.nagios.init,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- nagios-common.nagios.init 5 Dec 2004 05:45:19 -0000 1.3
+++ nagios-common.nagios.init 6 Feb 2005 00:12:58 -0000 1.4
@@ -142,7 +142,6 @@
fi
;;
restart)
- echo -n "Restarting $DESC: "
$0 stop
sleep 2
$0 start
Index: nagios-common.postinst
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.postinst,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- nagios-common.postinst 15 Dec 2004 23:17:40 -0000 1.6
+++ nagios-common.postinst 6 Feb 2005 00:12:58 -0000 1.7
@@ -129,9 +129,15 @@
if [ "$RET" = "true" ] ; then
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"
+ 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"
+ done
perl -wpi -e 's[^check_external_commands=1][check_external_commands=0]' /etc/nagios/nagios.cfg
fi
@@ -198,7 +204,7 @@
# Make sure the config file is readable by both nagios
# and apache
-chown -R nagios.www-data /var/log/nagios /etc/nagios /var/run/nagios /var/cache/nagios
+chown -R nagios:www-data /var/log/nagios /etc/nagios /var/run/nagios /var/cache/nagios
chmod 750 /etc/nagios/cgi.cfg
#DEBHELPER#
Index: nagios-common.postrm
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.postrm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- nagios-common.postrm 28 Nov 2004 18:25:35 -0000 1.4
+++ nagios-common.postrm 6 Feb 2005 00:12:58 -0000 1.5
@@ -38,6 +38,9 @@
db_purge
# Remove logfiles
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
else
# Remove apache config if wanted.
db_get nagios/configapache