pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/nagios-base



Module Name:    pkgsrc
Committed By:   manu
Date:           Sun Aug 20 06:59:16 UTC 2017

Modified Files:
        pkgsrc/net/nagios-base: Makefile distinfo
Added Files:
        pkgsrc/net/nagios-base/patches: patch-base_utils.c

Log Message:
Fix nagios unability to cleanup checkresults directory

>From upstream https://github.com/NagiosEnterprises/nagioscore/pull/417

Once nagios is done with a file in the checkresults directory,
it deletes it. This was done with a relative file path, causing
failures if nagios working directory is not the checkresults
directory. As a consequence, old result file remained intact,
causing system slowdowns as the directory grew and nagios spent
more and more time attempting to clean it up.

The fix is just to use an absolute path, so that it works
regardeless of current directory setting.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 pkgsrc/net/nagios-base/Makefile
cvs rdiff -u -r1.31 -r1.32 pkgsrc/net/nagios-base/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/net/nagios-base/patches/patch-base_utils.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/nagios-base/Makefile
diff -u pkgsrc/net/nagios-base/Makefile:1.72 pkgsrc/net/nagios-base/Makefile:1.73
--- pkgsrc/net/nagios-base/Makefile:1.72        Mon Aug 14 15:24:30 2017
+++ pkgsrc/net/nagios-base/Makefile     Sun Aug 20 06:59:16 2017
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.72 2017/08/14 15:24:30 jlam Exp $
+# $NetBSD: Makefile,v 1.73 2017/08/20 06:59:16 manu Exp $
 #
 
 DISTNAME=              nagios-4.3.2
 PKGNAME=               ${DISTNAME:S/-/-base-/}
-PKGREVISION=           2
+PKGREVISION=           3
 CATEGORIES=            net sysutils
 DISTFILES=             ${DISTNAME}${EXTRACT_SUFX}
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=nagios/}

Index: pkgsrc/net/nagios-base/distinfo
diff -u pkgsrc/net/nagios-base/distinfo:1.31 pkgsrc/net/nagios-base/distinfo:1.32
--- pkgsrc/net/nagios-base/distinfo:1.31        Wed May 24 07:42:39 2017
+++ pkgsrc/net/nagios-base/distinfo     Sun Aug 20 06:59:16 2017
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.31 2017/05/24 07:42:39 manu Exp $
+$NetBSD: distinfo,v 1.32 2017/08/20 06:59:16 manu Exp $
 
 SHA1 (nagios-4.3.2.tar.gz) = 3a8a765583bd0588e77d87d32d7f2d618911c1f0
 RMD160 (nagios-4.3.2.tar.gz) = f6e8f13b3c6caed38a8d83112b880ab2a2e1c6c9
@@ -14,6 +14,7 @@ SHA1 (patch-base_checks.c) = 9c5fb7a8f08
 SHA1 (patch-base_events.c) = 6b659c6980c69ab1947d7a829c87482f53ed817e
 SHA1 (patch-base_logging.c) = e0efd9dc51dd9f726ada11c6e7745e1cd9755bc9
 SHA1 (patch-base_nerd.c) = 4105d3a56999077688e42c9c771e76461fe00785
+SHA1 (patch-base_utils.c) = aaf6396ec4f8454a3f4a8e92a4881c32ff331dc0
 SHA1 (patch-cgi_Makefile.in) = 25c22914986c0b781f5dd665a7a53778e1031a63
 SHA1 (patch-cgi_avail.c) = 44b4b0f9eaf43dd35ea6c048b6fc1dbb295c7aeb
 SHA1 (patch-cgi_cmd.c) = edbf60422c4f36f045e97b27494bc7307c60143e

Added files:

Index: pkgsrc/net/nagios-base/patches/patch-base_utils.c
diff -u /dev/null pkgsrc/net/nagios-base/patches/patch-base_utils.c:1.1
--- /dev/null   Sun Aug 20 06:59:16 2017
+++ pkgsrc/net/nagios-base/patches/patch-base_utils.c   Sun Aug 20 06:59:16 2017
@@ -0,0 +1,62 @@
+$NetBSD: patch-base_utils.c,v 1.1 2017/08/20 06:59:16 manu Exp $
+
+From upstream https://github.com/NagiosEnterprises/nagioscore/pull/417
+
+Once nagios is done with a file in the checkresults directory,
+it deletes it. This was done with a relative file path, causing
+failures if nagios working directory is not the checkresults
+directory. As a consequence, old result file remained intact,
+causing system slowdowns as the directory grew and nagios spent
+more and more time attempting to clean it up.
+
+The fix is just to use an absolute path, so that it works
+regardeless of current directory setting.
+
+From 42f115ad87cf9113252f1d2ab88fc822ce052f56 Mon Sep 17 00:00:00 2001
+From: Bryan Heden <bheden%nagios.com@localhost>
+Date: Sat, 19 Aug 2017 12:02:34 -0500
+Subject: [PATCH] use absolute paths when deleting in checkresults directory.
+ github pull #417
+
+---
+ base/utils.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git base/utils.c base/utils.c
+index f2286c73..8116ebf9 100644
+--- base/utils.c
++++ base/utils.c
+@@ -2133,7 +2133,11 @@ int process_check_result_queue(char *dirname) {
+ 
+                       /* if the file is too old, we delete it */
+                       if (stat_buf.st_mtime + max_check_result_file_age < time(NULL)) {
+-                              delete_check_result_file(dirfile->d_name);
++
++                              if (delete_check_result_file(file) != OK 
++                                      && delete_check_result_file(dirfile->d_name) != OK)
++                                              logit(NSLOG_RUNTIME_WARNING, TRUE, "Error: Unable to delete '%s' or '%s'!", file, dirfile->d_name);
++
+                               continue;
+                               }
+ 
+@@ -2363,16 +2367,17 @@ int process_check_result_file(char *fname) {
+ /* deletes as check result file, as well as its ok-to-go file */
+ int delete_check_result_file(char *fname) {
+       char *temp_buffer = NULL;
++      int result = OK;
+ 
+       /* delete the result file */
+-      unlink(fname);
++      result = unlink(fname);
+ 
+       /* delete the ok-to-go file */
+       asprintf(&temp_buffer, "%s.ok", fname);
+-      unlink(temp_buffer);
++      result |= unlink(temp_buffer);
+       my_free(temp_buffer);
+ 
+-      return OK;
++      return result;
+       }
+ 
+ 



Home | Main Index | Thread Index | Old Index