diff --git a/import.log b/import.log index 7f59537..7c51886 100644 --- a/import.log +++ b/import.log @@ -1,3 +1,4 @@ nrpe-2_12-6_fc10:EL-5:nrpe-2.12-6.fc10.src.rpm:1233591102 nrpe-2_12-11_fc11:EL-5:nrpe-2.12-11.fc11.src.rpm:1253804375 nrpe-2_12-12_fc11:EL-5:nrpe-2.12-12.fc11.src.rpm:1256565082 +nrpe-2_12-13_fc12:EL-5:nrpe-2.12-13.fc12.src.rpm:1276858137 diff --git a/nrpe-0001-Add-reload-target-to-the-init-script.patch b/nrpe-0001-Add-reload-target-to-the-init-script.patch new file mode 100644 index 0000000..efe9c7a --- /dev/null +++ b/nrpe-0001-Add-reload-target-to-the-init-script.patch @@ -0,0 +1,34 @@ +From 0a988e01a0b2e1859990a26198d6c8adee001cca Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Fri, 18 Jun 2010 13:45:05 +0400 +Subject: [PATCH 1/6] Add reload target to the init-script + +--- + init-script.in | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/init-script.in b/init-script.in +index 07b17c7..0bd7629 100644 +--- a/init-script.in ++++ b/init-script.in +@@ -51,11 +51,16 @@ case "$1" in + $0 stop + $0 start + ;; ++ reload) ++ echo -n "Reloading nrpe" ++ killproc nrpe -HUP ++ echo ++ ;; + status) + status nrpe + ;; + *) +- echo "Usage: nrpe {start|stop|restart|status}" ++ echo "Usage: nrpe {start|stop|restart|reload|status}" + exit 1 + esac + +-- +1.6.6.1 + diff --git a/nrpe-0002-Read-extra-configuration-from-etc-sysconfig-nrpe.patch b/nrpe-0002-Read-extra-configuration-from-etc-sysconfig-nrpe.patch new file mode 100644 index 0000000..9c0af8c --- /dev/null +++ b/nrpe-0002-Read-extra-configuration-from-etc-sysconfig-nrpe.patch @@ -0,0 +1,39 @@ +From 34c2f96a4e2582f13bc07d8d03a128a31e06813f Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Fri, 18 Jun 2010 13:46:00 +0400 +Subject: [PATCH 2/6] Read extra configuration from /etc/sysconfig/nrpe + +See this rhbz for the details: +https://bugzilla.redhat.com/show_bug.cgi?id=449174 +--- + init-script.in | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/init-script.in b/init-script.in +index 0bd7629..720a96d 100644 +--- a/init-script.in ++++ b/init-script.in +@@ -24,6 +24,11 @@ fi + # Source networking configuration. + . /etc/sysconfig/network + ++# Read configuration (environment etc.) for nrpe and plugins ++if [ -f /etc/sysconfig/nrpe ]; then ++ . /etc/sysconfig/nrpe ++fi ++ + # Check that networking is up. + [ ${NETWORKING} = "no" ] && exit 0 + +@@ -36,7 +41,7 @@ case "$1" in + start) + # Start daemons. + echo -n "Starting nrpe: " +- daemon $NrpeBin -c $NrpeCfg -d ++ daemon $NrpeBin -c $NrpeCfg -d $NRPE_SSL_OPT + echo + touch $LockFile + ;; +-- +1.6.6.1 + diff --git a/nrpe-0003-Include-etc-npre.d-config-directory.patch b/nrpe-0003-Include-etc-npre.d-config-directory.patch new file mode 100644 index 0000000..61f4014 --- /dev/null +++ b/nrpe-0003-Include-etc-npre.d-config-directory.patch @@ -0,0 +1,28 @@ +From b91826cbeb34744623bce7d07a2c905d993742d2 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Fri, 18 Jun 2010 13:46:53 +0400 +Subject: [PATCH 3/6] Include /etc/npre.d config directory + +See this rhbz for the details: +https://bugzilla.redhat.com/show_bug.cgi?id=515324 +--- + sample-config/nrpe.cfg.in | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/sample-config/nrpe.cfg.in b/sample-config/nrpe.cfg.in +index 36575c0..d72ab3b 100644 +--- a/sample-config/nrpe.cfg.in ++++ b/sample-config/nrpe.cfg.in +@@ -169,8 +169,7 @@ connection_timeout=300 + # This directive allows you to include definitions from config files (with a + # .cfg extension) in one or more directories (with recursion). + +-#include_dir= +-#include_dir= ++include_dir=/etc/nrpe.d/ + + + +-- +1.6.6.1 + diff --git a/nrpe-0004-Fix-initscript-return-codes.patch b/nrpe-0004-Fix-initscript-return-codes.patch new file mode 100644 index 0000000..08bc13a --- /dev/null +++ b/nrpe-0004-Fix-initscript-return-codes.patch @@ -0,0 +1,65 @@ +From 3f8de2285a40f764c800de0ed4e4a7b0f8817656 Mon Sep 17 00:00:00 2001 +From: Ricky Zhou +Date: Fri, 18 Jun 2010 14:02:02 +0400 +Subject: [PATCH 4/6] Fix initscript return codes + +See this rhbz for the details: +https://bugzilla.redhat.com/show_bug.cgi?id=567141 +--- + init-script.in | 14 ++++++++++---- + 1 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/init-script.in b/init-script.in +index 720a96d..186c757 100644 +--- a/init-script.in ++++ b/init-script.in +@@ -36,21 +36,25 @@ NrpeBin=@bindir@/nrpe + NrpeCfg=@sysconfdir@/nrpe.cfg + LockFile=/var/lock/subsys/nrpe + ++RETVAL=0 ++ + # See how we were called. + case "$1" in + start) + # Start daemons. + echo -n "Starting nrpe: " + daemon $NrpeBin -c $NrpeCfg -d $NRPE_SSL_OPT ++ RETVAL=$? + echo +- touch $LockFile ++ [ $RETVAL = 0 ] && touch $LockFile + ;; + stop) + # Stop daemons. + echo -n "Shutting down nrpe: " + killproc nrpe ++ RETVAL=$? + echo +- rm -f $LockFile ++ [ $RETVAL = 0 ] && rm -f $LockFile + ;; + restart) + $0 stop +@@ -59,14 +63,16 @@ case "$1" in + reload) + echo -n "Reloading nrpe" + killproc nrpe -HUP ++ RETVAL=$? + echo + ;; + status) + status nrpe ++ RETVAL=$? + ;; + *) + echo "Usage: nrpe {start|stop|restart|reload|status}" +- exit 1 ++ RETVAL=2 + esac + +-exit 0 ++exit $RETVAL +-- +1.6.6.1 + diff --git a/nrpe-0005-Do-not-start-by-default.patch b/nrpe-0005-Do-not-start-by-default.patch new file mode 100644 index 0000000..0138b15 --- /dev/null +++ b/nrpe-0005-Do-not-start-by-default.patch @@ -0,0 +1,25 @@ +From cc3d3d04d9ae9ec4e8036784b60fc378908c57f7 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Fri, 18 Jun 2010 14:11:33 +0400 +Subject: [PATCH 5/6] Do not start by default + +--- + init-script.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/init-script.in b/init-script.in +index 186c757..ed6c366 100644 +--- a/init-script.in ++++ b/init-script.in +@@ -5,7 +5,7 @@ + # nrpe This shell script takes care of starting and stopping + # nrpe. + # +-# chkconfig: 2345 80 30 ++# chkconfig: - 80 30 + # description: nrpe is a daemon for a remote nagios server, \ + # running nagios plugins on this host. + # processname: nrpe +-- +1.6.6.1 + diff --git a/nrpe-0006-Relocate-pid-file.patch b/nrpe-0006-Relocate-pid-file.patch new file mode 100644 index 0000000..3e8707c --- /dev/null +++ b/nrpe-0006-Relocate-pid-file.patch @@ -0,0 +1,27 @@ +From c58026d6a575222dcfd40c49959ccfde6d2cb581 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Fri, 18 Jun 2010 14:14:13 +0400 +Subject: [PATCH 6/6] Relocate pid-file + +See this rhbz for the details: +https://bugzilla.redhat.com/show_bug.cgi?id=575544 +--- + sample-config/nrpe.cfg.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/sample-config/nrpe.cfg.in b/sample-config/nrpe.cfg.in +index d72ab3b..a31df4b 100644 +--- a/sample-config/nrpe.cfg.in ++++ b/sample-config/nrpe.cfg.in +@@ -23,7 +23,7 @@ log_facility=@log_facility@ + # number. The file is only written if the NRPE daemon is started by the root + # user and is running in standalone mode. + +-pid_file=/var/run/nrpe.pid ++pid_file=/var/run/nrpe/nrpe.pid + + + +-- +1.6.6.1 + diff --git a/nrpe-directory_for_configs.diff b/nrpe-directory_for_configs.diff deleted file mode 100644 index 4081a6b..0000000 --- a/nrpe-directory_for_configs.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff -up nrpe-2.12/sample-config/nrpe.cfg.in.orig nrpe-2.12/sample-config/nrpe.cfg.in ---- nrpe-2.12/sample-config/nrpe.cfg.in.orig 2009-08-03 19:49:20.000000000 +0200 -+++ nrpe-2.12/sample-config/nrpe.cfg.in 2009-08-03 19:50:43.000000000 +0200 -@@ -169,8 +169,7 @@ connection_timeout=300 - # This directive allows you to include definitions from config files (with a - # .cfg extension) in one or more directories (with recursion). - --#include_dir= --#include_dir= -+include_dir=/etc/nrpe.d/ - - - diff --git a/nrpe-initreload.patch b/nrpe-initreload.patch deleted file mode 100644 index 758d5d1..0000000 --- a/nrpe-initreload.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- init-script.in.orig 2006-03-05 16:03:15.000000000 -0600 -+++ init-script.in 2006-03-05 16:04:46.000000000 -0600 -@@ -51,6 +51,11 @@ - $0 stop - $0 start - ;; -+ reload) -+ echo -n "Reloading nrpe" -+ killproc nrpe -HUP -+ echo -+ ;; - status) - status nrpe - ;; diff --git a/nrpe-read-extra-conf.patch b/nrpe-read-extra-conf.patch deleted file mode 100644 index 1aaa32d..0000000 --- a/nrpe-read-extra-conf.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- init-script.in~ 2009-01-30 18:34:49.509236950 +0300 -+++ init-script.in 2009-01-30 18:37:09.797598582 +0300 -@@ -24,6 +24,11 @@ - # Source networking configuration. - . /etc/sysconfig/network - -+# Read configuration (environment etc.) for nrpe and plugins -+if [ -f /etc/sysconfig/nrpe ]; then -+ . /etc/sysconfig/nrpe -+fi -+ - # Check that networking is up. - [ ${NETWORKING} = "no" ] && exit 0 - -@@ -36,7 +41,7 @@ - start) - # Start daemons. - echo -n "Starting nrpe: " -- daemon $NrpeBin -c $NrpeCfg -d -+ daemon $NrpeBin -c $NrpeCfg -d $NRPE_SSL_OPT - echo - touch $LockFile - ;; diff --git a/nrpe.spec b/nrpe.spec index 8fd5635..4642204 100644 --- a/nrpe.spec +++ b/nrpe.spec @@ -2,7 +2,7 @@ Name: nrpe Version: 2.12 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Host/service/network monitoring agent for Nagios Group: Applications/System @@ -10,15 +10,18 @@ License: GPLv2 URL: http://www.nagios.org Source0: http://dl.sourceforge.net/nagios/%{name}-%{version}.tar.gz Source1: nrpe.sysconfig -Patch0: nrpe-initreload.patch -Patch1: nrpe-read-extra-conf.patch -Patch2: nrpe-directory_for_configs.diff +Patch1: nrpe-0001-Add-reload-target-to-the-init-script.patch +Patch2: nrpe-0002-Read-extra-configuration-from-etc-sysconfig-nrpe.patch +Patch3: nrpe-0003-Include-etc-npre.d-config-directory.patch +Patch4: nrpe-0004-Fix-initscript-return-codes.patch +Patch5: nrpe-0005-Do-not-start-by-default.patch +Patch6: nrpe-0006-Relocate-pid-file.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel -%if 0%{?rhel} +%if 0%{?el4}%{?el5} BuildRequires: tcp_wrappers %else BuildRequires: tcp_wrappers-devel @@ -56,9 +59,12 @@ This package provides the nrpe plugin for Nagios-related applications. %prep %setup -q -%patch0 -p0 -%patch1 -p0 -b .sysconfig -%patch2 -p1 -b .dir +%patch1 -p1 -b .reload +%patch2 -p1 -b .extra_config +%patch3 -p1 -b .include_etc_npre_d +%patch4 -p1 -b .initscript_return_codes +%patch5 -p1 -b .do_not_start_by_default +%patch6 -p1 -b .relocate_pid %build CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ @@ -75,7 +81,6 @@ CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ --localstatedir=%{_localstatedir}/log/nagios \ --enable-command-args make %{?_smp_mflags} all -sed -i "s/# chkconfig: 2345/# chkconfig: - /" init-script %install rm -rf %{buildroot} @@ -85,6 +90,7 @@ install -D -p -m 0755 src/nrpe %{buildroot}/%{_sbindir}/nrpe install -D -p -m 0755 src/check_nrpe %{buildroot}/%{_libdir}/nagios/plugins/check_nrpe install -D -p -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name} install -d %{buildroot}%{_sysconfdir}/nrpe.d +install -d %{buildroot}%{_localstatedir}/run/nrpe %clean @@ -116,6 +122,7 @@ fi %config(noreplace) %{_sysconfdir}/nagios/nrpe.cfg %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %doc Changelog LEGAL README README.SSL SECURITY docs/NRPE.pdf +%dir %attr(755, nrpe, nrpe) %{_localstatedir}/run/nrpe %files -n nagios-plugins-nrpe %defattr(-,root,root,-) @@ -123,6 +130,9 @@ fi %doc Changelog LEGAL README %changelog +* Fri Jun 18 2010 Peter Lemenkov - 2.12-13 +- Init-script enhancements (see rhbz #247001, #567141 and #575544) + * Mon Oct 26 2009 Peter Lemenkov - 2.12-12 - Do not own %%{_libdir}/nagios/plugins ( bz# 528974 ) - Fixed building against tcp_wrappers in Fedora ( bz# 528974 )