From: Kern Sibbald Date: Fri, 19 Oct 2007 11:47:58 +0000 (+0000) Subject: kes Set default debug_level to zero. This corrects bugs #991 and #993. X-Git-Tag: Release-2.2.6~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7ca12bc94619259eaf51cfd364f685b9b917b399;p=bacula%2Fbacula 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. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5771 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/2.2.5-deamon.patch b/bacula/patches/2.2.5-deamon.patch new file mode 100644 index 0000000000..6e82f1ea87 --- /dev/null +++ b/bacula/patches/2.2.5-deamon.patch @@ -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 + 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); diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index b6e6f9d3cb..7075d1b9a8 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -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); diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 56b6c7f051..2a5656b891 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -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.