[nsca] nsca 2.9
Xavier Bachelot
xavierb at fedoraproject.org
Tue Jan 24 20:11:36 UTC 2012
commit 381bf94ca1e026f0b63c25d3918ea8c5b050067f
Author: Xavier Bachelot <xavier at bachelot.org>
Date: Tue Jan 24 21:10:54 2012 +0100
nsca 2.9
.gitignore | 1 +
nsca-2.9-confpath.patch | 11 +++++
nsca-2.9-fix_open_missing_arg.patch | 11 +++++
nsca-2.9-initscript.patch | 74 +++++++++++++++++++++++++++++++++++
nsca.spec | 14 +++++--
sources | 2 +-
6 files changed, 108 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1f4b6c0..1051ef7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
nsca-2.7.2.tar.gz
+/nsca-2.9.tar.gz
diff --git a/nsca-2.9-confpath.patch b/nsca-2.9-confpath.patch
new file mode 100644
index 0000000..1ffb3ce
--- /dev/null
+++ b/nsca-2.9-confpath.patch
@@ -0,0 +1,11 @@
+--- nsca-2.9/src/send_nsca.c.orig 2011-11-04 19:21:29.000000000 +0100
++++ nsca-2.9/src/send_nsca.c 2012-01-16 21:40:43.769229431 +0100
+@@ -25,7 +25,7 @@
+ int server_port=DEFAULT_SERVER_PORT;
+ char server_name[MAX_HOST_ADDRESS_LENGTH];
+ char password[MAX_INPUT_BUFFER]="";
+-char config_file[MAX_INPUT_BUFFER]="send_nsca.cfg";
++char config_file[MAX_INPUT_BUFFER]="/etc/nagios/send_nsca.cfg";
+ char delimiter[2]="\t";
+ char block_delimiter[2]=BLOCK_DELIMITER;
+
diff --git a/nsca-2.9-fix_open_missing_arg.patch b/nsca-2.9-fix_open_missing_arg.patch
new file mode 100644
index 0000000..5d4ff4c
--- /dev/null
+++ b/nsca-2.9-fix_open_missing_arg.patch
@@ -0,0 +1,11 @@
+--- nsca-2.9/src/nsca.c.orig 2012-01-16 21:59:53.692250138 +0100
++++ nsca-2.9/src/nsca.c 2012-01-16 22:01:53.641670525 +0100
+@@ -477,7 +477,7 @@
+ int checkresult_test_fd=-1;
+ char *checkresult_test=NULL;
+ asprintf(&checkresult_test,"%s/nsca.test.%i",check_result_path,getpid());
+- checkresult_test_fd=open(checkresult_test,O_WRONLY|O_CREAT);
++ checkresult_test_fd=open(checkresult_test,O_WRONLY|O_CREAT,S_IWUSR);
+ if (checkresult_test_fd>0){
+ unlink(checkresult_test);
+ }
diff --git a/nsca-2.9-initscript.patch b/nsca-2.9-initscript.patch
new file mode 100644
index 0000000..238ede6
--- /dev/null
+++ b/nsca-2.9-initscript.patch
@@ -0,0 +1,74 @@
+--- init-script.in.orig 2010-07-31 13:12:55.000000000 +0200
++++ init-script.in 2010-07-31 13:28:10.000000000 +0200
+@@ -5,11 +5,11 @@
+ # This script takes care of starting and stopping the NSCA daemon.
+ # Modeled after init script for NRPE written by jaclu at grm.se
+ #
+-# chkconfig: 2345 80 30
++# chkconfig: - 80 20
+ # description: nsca is a daemon for accepting service check results \
+ # from applications running on other hosts.
+ # processname: nsca
+-# config: /usr/local/nagios/etc/nsca.cfg
++# config: /etc/nagios/nsca.cfg
+
+ # Source function library
+ if [ -f /etc/rc.d/init.d/functions ]; then
+@@ -26,10 +26,12 @@
+ # Check that networking is up.
+ [ ${NETWORKING} = "no" ] && exit 0
+
+-NscaBin=@bindir@/nsca
++NscaBin=@sbindir@/nsca
+ NscaCfg=@sysconfdir@/nsca.cfg
+ LockFile=/var/lock/subsys/nsca
+
++RETVAL=0
++
+ # See how we were called.
+ case "$1" in
+ start)
+@@ -38,27 +40,39 @@
+ daemon $NscaBin -s -c $NscaCfg
+ RETVAL=$?
+ echo
+- touch $LockFile
++ [ $RETVAL -eq 0 ] && touch $LockFile
+ ;;
+ stop)
+ # Stop daemons.
+ echo -n "Shutting down nsca: "
+ killproc nsca
++ RETVAL=$?
+ echo
+- rm -f $LockFile
++ [ $RETVAL -eq 0 ] && rm $LockFile
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
++ reload)
++ echo -n $"Reloading nsca: "
++ killproc nsca -HUP
++ RETVAL=$?
++ echo
++ ;;
++ condrestart)
++ [ -e $LockFile ] && $0 restart
++ RETVAL=$?
++ ;;
+ status)
+ status nsca
++ RETVAL=$?
+ ;;
+ *)
+- echo "Usage: nsca {start|stop|restart|status}"
++ echo "Usage: nsca {start|stop|restart|reload|condrestart|status}"
+ exit 1
+ esac
+
+-exit 0
++exit $RETVAL
+
+
diff --git a/nsca.spec b/nsca.spec
index a7937fc..1ed9c38 100644
--- a/nsca.spec
+++ b/nsca.spec
@@ -1,15 +1,16 @@
Summary: Nagios Service Check Acceptor
Name: nsca
-Version: 2.7.2
-Release: 10%{?dist}
+Version: 2.9
+Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://www.nagios.org/
Source: http://downloads.sourceforge.net/nagios/nsca-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Patch0: nsca-2.7.2-initscript.patch
-Patch1: nsca-2.7.2-confpath.patch
+Patch0: nsca-2.9-initscript.patch
+Patch1: nsca-2.9-confpath.patch
+Patch2: nsca-2.9-fix_open_missing_arg.patch
BuildRequires: libmcrypt-devel
Requires: nagios
@@ -36,6 +37,7 @@ Client application for sending updates to a nsca server.
%setup -q
%patch0 -p0 -b .initscript
%patch1 -p1 -b .confpath
+%patch2 -p1 -b .open
# Change defaults in the config file to match the nagios package
sed -i -e "s|^command_file=.*|command_file=%{_localstatedir}/spool/nagios/cmd/nagios.cmd|" \
-e "s|^alternate_dump_file=.*|alternate_dump_file=%{_localstatedir}/spool/nagios/cmd/nsca.dump|" \
@@ -99,6 +101,10 @@ rm -rf %{buildroot}
%changelog
+* Mon Jan 16 2012 Xavier Bachelot <xavier at bachelot.org> - 2.9-1
+- Update to 2.9.
+- Fix initscript return code (RHBZ#620013).
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.7.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/sources b/sources
index def72d6..d72c331 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-33a98e7975f633a9489d7a8938ed6131 nsca-2.7.2.tar.gz
+0351e2bd437e78463113abce6305307e nsca-2.9.tar.gz
More information about the scm-commits
mailing list