[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, upstream, updated. e9a5a6997d9dd8b31b433b5bcbad495448db0131

Sven Nierlein sven at nierlein.org
Thu Apr 7 08:06:57 UTC 2011


The following commit has been merged in the upstream branch:
commit e9a5a6997d9dd8b31b433b5bcbad495448db0131
Author: Sven Nierlein <sven at nierlein.org>
Date:   Wed Mar 23 21:48:23 2011 +0100

    fixed worker segfault with exit codes > 128

diff --git a/README.asciidoc b/README.asciidoc
index a5c9649..f90f8be 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -729,7 +729,7 @@ Hints
 Download
 --------
 
-* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz[version 1.0.2 - March 13 2011]
+* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz[version 1.0.3 - March 23 2011]
 * Mod Gearman is available for download at: http://labs.consol.de/nagios/mod-gearman
 * The source is available at GitHub: http://github.com/sni/mod_gearman
 
@@ -737,6 +737,7 @@ Download
 Archive
 ~~~~~~~
 
+* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz[version 1.0.3 - March 23 2011]
 * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz[version 1.0.2 - March 13 2011]
 * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.1.tar.gz[version 1.0.1 - March 05 2011]
 * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.tar.gz[version 1.0 - February 08 2011]
diff --git a/common/utils.c b/common/utils.c
index 2560b9a..57fcd14 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -879,7 +879,9 @@ char * nr2signal(int sig) {
                  break;
         case 16: signame = "SIGURG";
                  break;
-        default: snprintf(signame, 20, "signal %d", sig);
+        default: signame = malloc(20);
+                 snprintf(signame, 20, "signal %d", sig);
+                 return signame;
                  break;
     }
     return strdup(signame);
@@ -1174,7 +1176,7 @@ int execute_safe_command(gm_job_t * exec_job, int fork_exec, char * hostname) {
             snprintf( buffer, sizeof( buffer )-1, "CRITICAL: Return code of 127 is out of bounds. Make sure the plugin you're trying to run actually exists. (worker: %s)", hostname);
         }
         /* signaled */
-        else if(return_code >= 128 && return_code < 256) {
+        else if(return_code >= 128 && return_code < 144) {
             char * signame = nr2signal((int)(return_code-128));
             snprintf( buffer, sizeof( buffer )-1, "CRITICAL: Return code of %d is out of bounds. Plugin exited by signal %s. (worker: %s)", (int)(return_code), signame, hostname);
             return_code = STATE_CRITICAL;
diff --git a/configure.ac b/configure.ac
index e8cf660..5091b80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 
 ##############################################
 AC_PREREQ([2.59])
-AC_INIT([mod_gearman], [1.0.2], [sven.nierlein at consol.de])
+AC_INIT([mod_gearman], [1.0.3], [sven.nierlein at consol.de])
 AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
 AC_CONFIG_SRCDIR([neb_module/mod_gearman.c],[worker/worker.c],[tools/send_gearman.c],[tools/check_gearman.c],[tools/gearman_top.c])
 AC_CONFIG_HEADER([config.h])
diff --git a/docs/QUICKSTART b/docs/QUICKSTART
index 62862b0..08db98d 100644
--- a/docs/QUICKSTART
+++ b/docs/QUICKSTART
@@ -52,9 +52,9 @@ Half way done, the next step installs Mod-Gearman.
 
 --------------------------------------
 #> cd /tmp
-#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz"
-#> tar zxf mod_gearman-1.0.2.tar.gz
-#> cd mod_gearman-1.0.2
+#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz"
+#> tar zxf mod_gearman-1.0.3.tar.gz
+#> cd mod_gearman-1.0.3
 #> ./configure --prefix=/opt --with-gearman=/opt --with-user=nagios --with-init-dir=/etc/init.d
 #> make
 #> make install
@@ -118,7 +118,7 @@ Your nagios.log should contain a line:
 
 --------------------------------------
 #> grep mod_gearman /var/log/nagios3/nagios.log
-[1295003042] mod_gearman: Version 1.0.2
+[1295003042] mod_gearman: Version 1.0.3
 [1295003042] Event broker module '/opt/lib/mod_gearman/mod_gearman.o' initialized successfully.
 --------------------------------------
 
@@ -155,7 +155,7 @@ Then we have a look at the shiped check plugin:
 
 --------------------------------------
 #> /opt/bin/check_gearman -H localhost -q worker_`hostname` -t 10 -s check
-check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.2|worker=1 jobs=2c
+check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.3|worker=1 jobs=2c
 --------------------------------------
 
 The interesting number is the last one, '2c' in our case, which means there
diff --git a/docs/QUICKSTART.html b/docs/QUICKSTART.html
index 364dead..b76ef7f 100644
--- a/docs/QUICKSTART.html
+++ b/docs/QUICKSTART.html
@@ -606,9 +606,9 @@ install Gearman from source.</p></div>
 <div class="listingblock">
 <div class="content">
 <pre><tt>#&gt; cd /tmp
-#&gt; wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz"
-#&gt; tar zxf mod_gearman-1.0.2.tar.gz
-#&gt; cd mod_gearman-1.0.2
+#&gt; wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz"
+#&gt; tar zxf mod_gearman-1.0.3.tar.gz
+#&gt; cd mod_gearman-1.0.3
 #&gt; ./configure --prefix=/opt --with-gearman=/opt --with-user=nagios --with-init-dir=/etc/init.d
 #&gt; make
 #&gt; make install
@@ -666,7 +666,7 @@ Restarting nagios3 monitoring daemon: nagios3</tt></pre>
 <div class="listingblock">
 <div class="content">
 <pre><tt>#&gt; grep mod_gearman /var/log/nagios3/nagios.log
-[1295003042] mod_gearman: Version 1.0.2
+[1295003042] mod_gearman: Version 1.0.3
 [1295003042] Event broker module '/opt/lib/mod_gearman/mod_gearman.o' initialized successfully.</tt></pre>
 </div></div>
 </div>
@@ -696,7 +696,7 @@ worker_debian64 |               1  |           0  |           0</p></div>
 <div class="listingblock">
 <div class="content">
 <pre><tt>#&gt; /opt/bin/check_gearman -H localhost -q worker_`hostname` -t 10 -s check
-check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.2|worker=1 jobs=2c</tt></pre>
+check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.3|worker=1 jobs=2c</tt></pre>
 </div></div>
 <div class="paragraph"><p>The interesting number is the last one, <em>2c</em> in our case, which means there
 have been already 2 jobs executed by this worker.</p></div>
@@ -736,7 +736,7 @@ Mod-Gearman Worker: /opt/var/mod_gearman/mod_gearman_worker.log
 <div id="footnotes"><hr /></div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2011-03-13 22:20:35 CEST
+Last updated 2011-03-23 21:48:03 CEST
 </div>
 </div>
 </body>
diff --git a/docs/README.html b/docs/README.html
index b9b51b9..b00e47c 100644
--- a/docs/README.html
+++ b/docs/README.html
@@ -1559,7 +1559,7 @@ Make sure all your worker have the nagios-plugins available under
 <div class="ulist"><ul>
 <li>
 <p>
-<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz">version 1.0.2 - March 13 2011</a>
+<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz">version 1.0.3 - March 23 2011</a>
 </p>
 </li>
 <li>
@@ -1577,6 +1577,11 @@ The source is available at GitHub: <a href="http://github.com/sni/mod_gearman">h
 <div class="ulist"><ul>
 <li>
 <p>
+<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz">version 1.0.3 - March 23 2011</a>
+</p>
+</li>
+<li>
+<p>
 <a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz">version 1.0.2 - March 13 2011</a>
 </p>
 </li>
@@ -1626,7 +1631,7 @@ The source is available at GitHub: <a href="http://github.com/sni/mod_gearman">h
 <div id="footnotes"><hr /></div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2011-03-13 22:20:22 CEST
+Last updated 2011-03-23 21:47:45 CEST
 </div>
 </div>
 </body>
diff --git a/include/common.h b/include/common.h
index 649d720..1683682 100644
--- a/include/common.h
+++ b/include/common.h
@@ -52,7 +52,7 @@
 #define MOD_GM_COMMON_H
 
 /* constants */
-#define GM_VERSION                 "1.0.2"
+#define GM_VERSION                 "1.0.3"
 #define GM_ENABLED                      1
 #define GM_DISABLED                     0
 #define GM_BUFFERSIZE               98304
diff --git a/support/mod_gearman.spec b/support/mod_gearman.spec
index f2f91cf..fef3917 100644
--- a/support/mod_gearman.spec
+++ b/support/mod_gearman.spec
@@ -1,5 +1,5 @@
 Name:          mod_gearman
-Version:       1.0.2
+Version:       1.0.3
 Release:       3
 License:       GNU Public License version 2
 Packager:      Olivier Raginel <babar at cern.ch>
diff --git a/t/03-exec_checks.c b/t/03-exec_checks.c
index 72ba6cb..497541e 100644
--- a/t/03-exec_checks.c
+++ b/t/03-exec_checks.c
@@ -16,7 +16,7 @@ int main(void) {
     char cmd[100];
     char hostname[GM_BUFFERSIZE];
 
-    plan(34);
+    plan(40);
 
     /* set hostname */
     gethostname(hostname, GM_BUFFERSIZE-1);
@@ -158,6 +158,23 @@ int main(void) {
     cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line);
     like(exec_job->output, "CRITICAL: Return code of 5 is out of bounds. \\(worker:", "returned result string");
 
+    /* unknown exit code 3 */
+    exec_job->command_line = strdup("./t/rc 128 2>&1");
+    execute_safe_command(exec_job, fork_on_exec, hostname);
+    cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line);
+    like(exec_job->output, "CRITICAL: Return code of 128 is out of bounds. Plugin exited by signal signal 0. \\(worker:", "returned result string");
+
+    /* unknown exit code 4 */
+    exec_job->command_line = strdup("./t/rc 137 2>&1");
+    execute_safe_command(exec_job, fork_on_exec, hostname);
+    cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line);
+    like(exec_job->output, "CRITICAL: Return code of 137 is out of bounds. Plugin exited by signal SIGKILL. \\(worker:", "returned result string");
+
+    /* unknown exit code 5 */
+    exec_job->command_line = strdup("./t/rc 255 2>&1");
+    execute_safe_command(exec_job, fork_on_exec, hostname);
+    cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line);
+    like(exec_job->output, "CRITICAL: Return code of 255 is out of bounds. \\(worker:", "returned result string");
 
 
     /*****************************************

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list