]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Set default debug_level to zero. This corrects bugs #991 and #993.
authorKern Sibbald <kern@sibbald.com>
Fri, 19 Oct 2007 11:47:58 +0000 (11:47 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 19 Oct 2007 11:47:58 +0000 (11:47 +0000)
kes  Fix a crash in bat when it cannot connect to the Director for example
     if the Director is not running.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5771 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/2.2.5-deamon.patch [new file with mode: 0644]
bacula/src/lib/message.c
bacula/technotes-2.1

diff --git a/bacula/patches/2.2.5-deamon.patch b/bacula/patches/2.2.5-deamon.patch
new file mode 100644 (file)
index 0000000..6e82f1e
--- /dev/null
@@ -0,0 +1,40 @@
+
+ This patch fixes the default behavior of a non-DEVELOPER version of Bacula
+ to close STDIN, STDOUT, and STDERR so that an ssh that starts bacula
+ will not hang.  It also fixes a crash in bat when bat is executed and
+ cannot connect to the Director (e.g. it is not running).
+ This patch fixes bugs #991 and #993.
+
+ Apply this fix to Bacula version 2.2.5 with:
+
+ cd <bacula-source>
+ patch -p0 <2.2.5-daemon.patch
+ ./configure (your options)
+ make
+ ...
+ make install
+
+
+Index: src/lib/message.c
+===================================================================
+--- src/lib/message.c  (revision 5744)
++++ src/lib/message.c  (working copy)
+@@ -52,7 +52,8 @@
+  */
+ const char *working_directory = NULL;       /* working directory path stored here */
+ int verbose = 0;                      /* increase User messages */
+-int debug_level = 1;                  /* debug level */
++/* Keep debug level set to zero by default */
++int debug_level = 0;                  /* debug level */
+ time_t daemon_start_time = 0;         /* Daemon start time */
+ const char *version = VERSION " (" BDATE ")";
+ char my_name[30];                     /* daemon name is stored here */
+@@ -1338,7 +1339,7 @@
+       jcr = get_jcr_from_tsd();
+    }
+    /* If no jcr or dequeuing send to daemon to avoid recursion */
+-   if (!jcr || jcr->dequeuing) {
++   if ((jcr && !jcr->msg_queue) || !jcr || jcr->dequeuing) {
+       /* jcr==NULL => daemon message, safe to send now */
+       Jmsg(jcr, item->type, item->mtime, "%s", item->msg);
+       free(item);
index b6e6f9d3cb89a137281de74e7fa28004566200fa..7075d1b9a886edfc33555b25d5d5ae24a6877626 100644 (file)
@@ -52,7 +52,8 @@ sql_escape p_sql_escape = NULL;
  */
 const char *working_directory = NULL;       /* working directory path stored here */
 int verbose = 0;                      /* increase User messages */
-int debug_level = 1;                  /* debug level */
+/* Keep debug level set to zero by default */
+int debug_level = 0;                  /* debug level */
 time_t daemon_start_time = 0;         /* Daemon start time */
 const char *version = VERSION " (" BDATE ")";
 char my_name[30];                     /* daemon name is stored here */
@@ -1338,7 +1339,7 @@ void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
       jcr = get_jcr_from_tsd();
    }
    /* If no jcr or dequeuing send to daemon to avoid recursion */
-   if (!jcr || jcr->dequeuing) {
+   if ((jcr && !jcr->msg_queue) || !jcr || jcr->dequeuing) {
       /* jcr==NULL => daemon message, safe to send now */
       Jmsg(jcr, item->type, item->mtime, "%s", item->msg);
       free(item);
index 56b6c7f0515b4f15aa2019e3816166867f0eae6b..2a5656b891f373b58d57a0c6e04cfac1814c5b94 100644 (file)
@@ -1,6 +1,10 @@
               Technical notes on version 2.2
 
 General:
+19Oct07
+kes  Set default debug_level to zero. This corrects bugs #991 and #993. 
+kes  Fix a crash in bat when it cannot connect to the Director for example
+     if the Director is not running.
 16Oct07
 kes  Activate Close button on tray-monitor window. This fixes
      bug #986.