diff --git a/import.log b/import.log new file mode 100644 index 0000000..6990abb --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +nagios-3_2_0-4_fc12:HEAD:nagios-3.2.0-4.fc12.src.rpm:1267098879 diff --git a/nagios-0001-from-rpm.patch b/nagios-0001-from-rpm.patch new file mode 100644 index 0000000..404d4bd --- /dev/null +++ b/nagios-0001-from-rpm.patch @@ -0,0 +1,31 @@ +From 407c6e16ee99b2e12de526285f4ca74990ea2503 Mon Sep 17 00:00:00 2001 +From: Mike McGrath +Date: Thu, 25 Feb 2010 14:21:30 +0300 +Subject: [PATCH 1/3] from rpm + +--- + daemon-init.in | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/daemon-init.in b/daemon-init.in +index cdb9b93..f2feb9d 100644 +--- a/daemon-init.in ++++ b/daemon-init.in +@@ -124,11 +124,13 @@ case "$1" in + echo -n "Starting nagios:" + $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1; + if [ $? -eq 0 ]; then +- su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile" ++ touch $NagiosVarDir/nagios.log $NagiosRetentionFile ++ chown $NagiosUser:$NagiosGroup $NagiosVarDir/nagios.log $NagiosRetentionFile + rm -f $NagiosCommandFile + touch $NagiosRunFile + chown $NagiosUser:$NagiosGroup $NagiosRunFile + $NagiosBin -d $NagiosCfgFile ++ pidof nagios > $NagiosRunFile + if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi + echo " done." + exit 0 +-- +1.6.6.1 + diff --git a/nagios-0002-SELinux-relabeling.patch b/nagios-0002-SELinux-relabeling.patch new file mode 100644 index 0000000..d592e58 --- /dev/null +++ b/nagios-0002-SELinux-relabeling.patch @@ -0,0 +1,27 @@ +From 53ddfdb8b51b0164e71240aadbfba489158849c3 Mon Sep 17 00:00:00 2001 +From: Daniel Walsh +Date: Thu, 25 Feb 2010 14:24:00 +0300 +Subject: [PATCH 2/3] SELinux relabeling + +This patch adds a restorecon call to the init script to label the pid file +correctly. + +--- + daemon-init.in | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/daemon-init.in b/daemon-init.in +index f2feb9d..d544eb4 100644 +--- a/daemon-init.in ++++ b/daemon-init.in +@@ -129,6 +129,7 @@ case "$1" in + rm -f $NagiosCommandFile + touch $NagiosRunFile + chown $NagiosUser:$NagiosGroup $NagiosRunFile ++ [-x /sbin/restorecon ] && /sbin/restorecon $NagiosRunFile + $NagiosBin -d $NagiosCfgFile + pidof nagios > $NagiosRunFile + if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi +-- +1.6.6.1 + diff --git a/nagios-0003-Fix-etc-init.d-nagios-status.patch b/nagios-0003-Fix-etc-init.d-nagios-status.patch new file mode 100644 index 0000000..5a49c96 --- /dev/null +++ b/nagios-0003-Fix-etc-init.d-nagios-status.patch @@ -0,0 +1,43 @@ +From c149a6dc2fe9cddd0986fad9cb654774692bb499 Mon Sep 17 00:00:00 2001 +From: Ricky Zhou +Date: Thu, 25 Feb 2010 14:27:08 +0300 +Subject: [PATCH 3/3] Fix /etc/init.d/nagios status + +Fix status return code. + +--- + daemon-init.in | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/daemon-init.in b/daemon-init.in +index d544eb4..460370d 100644 +--- a/daemon-init.in ++++ b/daemon-init.in +@@ -52,12 +52,14 @@ status_nagios () + + printstatus_nagios() + { +- +- if status_nagios $1 $2; then ++ status_nagios $1 $2 ++ RETVAL=$? ++ if [ $RETVAL = 0 ]; then + echo "nagios (pid $NagiosPID) is running..." + else + echo "nagios is not running" + fi ++ return $RETVAL + } + + +@@ -174,6 +176,7 @@ case "$1" in + status) + pid_nagios + printstatus_nagios nagios ++ exit $? + ;; + + checkconfig) +-- +1.6.6.1 + diff --git a/nagios-initrd.patch b/nagios-initrd.patch deleted file mode 100644 index 03247ef..0000000 --- a/nagios-initrd.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- daemon-init.in.orig 2008-10-20 08:40:35.000000000 +0200 -+++ daemon-init.in 2008-10-20 08:41:15.000000000 +0200 -@@ -124,11 +124,13 @@ - echo -n "Starting nagios:" - $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1; - if [ $? -eq 0 ]; then -- su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile" -+ touch $NagiosVarDir/nagios.log $NagiosRetentionFile -+ chown $NagiosUser:$NagiosGroup $NagiosVarDir/nagios.log $NagiosRetentionFile - rm -f $NagiosCommandFile - touch $NagiosRunFile - chown $NagiosUser:$NagiosGroup $NagiosRunFile - $NagiosBin -d $NagiosCfgFile -+ pidof nagios > $NagiosRunFile - if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi - echo " done." - exit 0 diff --git a/nagios.cfg.patch b/nagios.cfg.patch deleted file mode 100644 index 2ed09ee..0000000 --- a/nagios.cfg.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- sample-config/nagios.cfg.in-orig 2008-07-01 22:19:08.000000000 +0200 -+++ sample-config/nagios.cfg.in 2008-07-01 22:20:24.000000000 +0200 -@@ -54,6 +54,10 @@ - #cfg_dir=@sysconfdir@/switches - #cfg_dir=@sysconfdir@/routers - -+#Included by Robert M. Albrecht for Fedora -+cfg_dir=@sysconfdir@/conf.d -+ -+ - - - diff --git a/nagios.spec b/nagios.spec index c778004..e89bd52 100644 --- a/nagios.spec +++ b/nagios.spec @@ -1,6 +1,6 @@ Name: nagios Version: 3.2.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Host/service/network monitoring program Group: Applications/System @@ -13,13 +13,18 @@ Source3: nagios.internet.cfg Source4: nagios.htpasswd Source5: nagios.upgrade_to_v3.ReadMe Source6: nagios.upgrade_to_v3.sh -Patch0: nagios-initrd.patch -#Patch1: nagios.cfg.patch +Patch1: nagios-0001-from-rpm.patch +Patch2: nagios-0002-SELinux-relabeling.patch +Patch3: nagios-0003-Fix-etc-init.d-nagios-status.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gd-devel > 1.8, mailx, libjpeg-devel, libpng-devel -BuildRequires: perl-devel -BuildRequires: perl(ExtUtils::Embed) +BuildRequires: perl(CPAN) +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(ExtUtils::Embed) +BuildRequires: perl(Test::Harness) +BuildRequires: perl(Test::More) +BuildRequires: perl(Test::Simple) Requires: httpd Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) @@ -76,10 +81,12 @@ may compile against. %prep %setup -q -%patch0 -p0 +%patch1 -p1 -b .fedora +%patch2 -p1 -b .selinux_relabel +%patch3 -p1 -b .fix_status_retcode %build -./configure \ +%configure \ --prefix=%{_datadir}/%{name} \ --exec-prefix=%{_localstatedir}/lib/%{name} \ --with-init-dir=%{_initrddir} \ @@ -203,6 +210,12 @@ fi %{_includedir}/%{name} %changelog +* Thu Feb 25 2010 Peter Lemenkov - 3.2.0-4 +- The package builds now with distro CFLAGS, CXXFLAGS (see bz #520979) +- Fixed returning status for init-script (see bz #546561) +- Fixed selinux issue with writing of PID-file (see bz #548638 and bz #539963) +- Fixed build on EPEL (see bz #526817) + * Mon Dec 7 2009 Stepan Kasal - 3.2.0-3 - rebuild against perl 5.10.1