[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bacula-commits
Subject:    [Bacula-commits] git: Bacula branch, Branch-5.0,
From:       "Kern Sibbald" <kerns () users ! sourceforge ! net>
Date:       2010-06-09 18:07:24
Message-ID: E1OMPgU-0002M7-8t () sfp-scmshell-1 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Bacula".

The branch, Branch-5.0 has been updated
       via  1714b945a5384c7182bd3ab3d0a36423baec1850 (commit)
       via  c765c2745e0192792b088325477383f3faf52d86 (commit)
       via  03bab692947d2a1742016b27e78284c746a73c4a (commit)
       via  a0d50ea7fa2f7c9a8de19cf0dadcb0e0bfa024b8 (commit)
       via  574c15dbfe38e0308d1f53a8bc0a252edc958caf (commit)
       via  624d6f6374e5d3591af31261994db330cbc78160 (commit)
       via  6360c734f045a9944b159aef2f445c018e843a8e (commit)
       via  2cf2eb7c4d819d8c8ab602dcf37d8b154958265d (commit)
       via  47376421308d90bf1d22f317653984cc9530b524 (commit)
       via  cd33d61244cdc464f17ef25a4e2a0e0a0c0df904 (commit)
       via  30be33d68658cf8f5bf1d428158b9fba79ccefbb (commit)
       via  2dee71339539210dae104012df11f44a00280ab4 (commit)
       via  551c56b2d9b89cf359593cfc11a17c557319551e (commit)
       via  3d6ff23c975ff2b684a4a00540eec43d01955715 (commit)
       via  267a54e5345d2aabe6ec39cac6fb6a2b2709eb19 (commit)
       via  691426f36e2080c8fdfb3270d0c6bc7540b006ff (commit)
       via  bd242e42c1e4318bfd2ac50d890fc2cf853e039e (commit)
       via  3689163b7761d68490d43ea90abf08a4bf351eea (commit)
       via  e55c99331501f60308ffc27a7226187ea0dbee08 (commit)
       via  38c432b80e4aad26be1e4badf4ae2b2de0378ecd (commit)
      from  db57532ffd9442338106ef4e3e47177ec35c2c7c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1714b945a5384c7182bd3ab3d0a36423baec1850
Author: Kern Sibbald <kern@sibbald.com>
Date:   Mon Jun 7 22:01:56 2010 +0200

    Apply literal string fix in printf submitted by Luca Berra

commit c765c2745e0192792b088325477383f3faf52d86
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Thu Jun 3 16:25:42 2010 +0200

    regress: fix multi2-storage-test

commit 03bab692947d2a1742016b27e78284c746a73c4a
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Jun 3 14:24:00 2010 +0200

    Fix bug #1582 Restore from multiple storage daemons breaks subsequent backups

commit a0d50ea7fa2f7c9a8de19cf0dadcb0e0bfa024b8
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Tue Jun 1 22:50:17 2010 +0200

    Fix segfault on "cancel jobid=" command

commit 574c15dbfe38e0308d1f53a8bc0a252edc958caf
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Tue Jun 1 15:27:31 2010 +0200

    Change libtool version

commit 624d6f6374e5d3591af31261994db330cbc78160
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Tue Jun 1 14:40:36 2010 +0200

    regress: tweak multi2-storage-test

commit 6360c734f045a9944b159aef2f445c018e843a8e
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sun May 30 12:06:58 2010 +0200

    Fix bug #1554 Windows installer doesn't honor /S flag

commit 2cf2eb7c4d819d8c8ab602dcf37d8b154958265d
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sun May 30 11:18:54 2010 +0200

    Fix typo reported in bug #1585

commit 47376421308d90bf1d22f317653984cc9530b524
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat May 29 17:37:59 2010 +0200

    Tweak: use C++ rather than C and use Bacula indenting standards

commit cd33d61244cdc464f17ef25a4e2a0e0a0c0df904
Author: Kern Sibbald <kern@sibbald.com>
Date:   Fri Apr 23 10:59:42 2010 +0200

    Remove pool zap code that breaks 2drive-concurrent-test

commit 30be33d68658cf8f5bf1d428158b9fba79ccefbb
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Fri May 28 09:15:24 2010 +0200

    Fix #1571 and install libraries with 755 perms

commit 2dee71339539210dae104012df11f44a00280ab4
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu May 27 22:41:12 2010 +0200

    Fix bug #1581 ASSERTs in src/dird/jobq.c can never trigger

commit 551c56b2d9b89cf359593cfc11a17c557319551e
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Thu May 27 15:31:55 2010 +0200

    regress: test when a multi-storage restore needs to wait for a busy drive

commit 3d6ff23c975ff2b684a4a00540eec43d01955715
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Thu May 27 15:16:15 2010 +0200

    regress: tweak multi2-storage-test

commit 267a54e5345d2aabe6ec39cac6fb6a2b2709eb19
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Thu May 27 14:50:54 2010 +0200

    regress: Reproduce #1582 about multiple devices restore

commit 691426f36e2080c8fdfb3270d0c6bc7540b006ff
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Thu May 20 12:05:43 2010 +0200

    Fix problem with BaseJob and Accurate FileSet options on client side

commit bd242e42c1e4318bfd2ac50d890fc2cf853e039e
Author: Kern Sibbald <kern@sibbald.com>
Date:   Mon May 24 12:08:27 2010 +0200

    Add more debug code for bactrace

commit 3689163b7761d68490d43ea90abf08a4bf351eea
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sun May 23 18:37:10 2010 +0200

    Fix for bug #1569 deadlock/crash in Dir

commit e55c99331501f60308ffc27a7226187ea0dbee08
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Mon May 3 10:02:58 2010 +0200

    Fix segfault when loading Plugins

commit 38c432b80e4aad26be1e4badf4ae2b2de0378ecd
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Tue May 4 17:22:25 2010 +0200

    Fix #1567 about display of long volume names truncated during restore

-----------------------------------------------------------------------

Summary of changes:
diff --git a/bacula/autoconf/Make.common.in b/bacula/autoconf/Make.common.in
index f558369..d871975 100644
--- a/bacula/autoconf/Make.common.in
+++ b/bacula/autoconf/Make.common.in
@@ -57,6 +57,7 @@ MKDIR = @BUILD_DIR@/autoconf/mkinstalldirs
 INSTALL = @INSTALL@
 # add the -s to the following in PRODUCTION mode
 INSTALL_PROGRAM = $(INSTALL) -m @SBINPERM@
+INSTALL_LIB = $(INSTALL) -m 755
 INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_SCRIPT = $(INSTALL) -m @SBINPERM@
 INSTALL_CONFIG = $(INSTALL) -m 640
diff --git a/bacula/src/bacula.h b/bacula/src/bacula.h
index ab0ba1a..bab5f1f 100644
--- a/bacula/src/bacula.h
+++ b/bacula/src/bacula.h
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -28,7 +28,6 @@
 /*
  * bacula.h -- main header file to include in all Bacula source
  *
- *   Version $Id$
  */
 
 #ifndef _BACULA_H
diff --git a/bacula/src/cats/Makefile.in b/bacula/src/cats/Makefile.in
index 2ad0078..ca54865 100644
--- a/bacula/src/cats/Makefile.in
+++ b/bacula/src/cats/Makefile.in
@@ -131,7 +131,7 @@ uninstall-includes:
 
 libtool-install: all
 	$(MKDIR) $(DESTDIR)$(libdir)
-	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacsql$(DEFAULT_ARCHIVE_TYPE) \
$(DESTDIR)$(libdir) +	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) \
libbacsql$(DEFAULT_ARCHIVE_TYPE) $(DESTDIR)$(libdir)  
 libtool-uninstall:
 	$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacsql.la
diff --git a/bacula/src/dird/bsr.c b/bacula/src/dird/bsr.c
index eefce24..c72550f 100644
--- a/bacula/src/dird/bsr.c
+++ b/bacula/src/dird/bsr.c
@@ -279,7 +279,7 @@ static void display_vol_info(UAContext *ua, RESTORE_CTX &rx, \
JobId_t JobId)  } else {
                online = ' ';
             }
-            Mmsg(volmsg, "%c%-25.25s %-25.25s %-25.25s", 
+            Mmsg(volmsg, "%c%-25s %-25s %-25s", 
                  online, bsr->VolParams[i].VolumeName,
                  bsr->VolParams[i].Storage, Device);
             add_prompt(ua, volmsg.c_str());
diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h
index cf82a7e..754b6db 100644
--- a/bacula/src/dird/dird_conf.h
+++ b/bacula/src/dird/dird_conf.h
@@ -258,8 +258,8 @@ public:
    char *address;
    char *password;
    CAT *catalog;                      /* Catalog resource */
-   uint32_t MaxConcurrentJobs;        /* Maximume concurrent jobs */
-   uint32_t NumConcurrentJobs;        /* number of concurrent jobs running */
+   int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
+   int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
    char *tls_ca_certfile;             /* TLS CA Certificate File */
    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
    char *tls_certfile;                /* TLS Client Certificate File */
@@ -292,9 +292,9 @@ public:
    char *password;
    char *media_type;
    alist *device;                     /* Alternate devices for this Storage */
-   uint32_t MaxConcurrentJobs;        /* Maximume concurrent jobs */
-   uint32_t NumConcurrentJobs;        /* number of concurrent jobs running */
-   uint32_t NumConcurrentReadJobs;    /* number of jobs reading */
+   int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
+   int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
+   int32_t NumConcurrentReadJobs;     /* number of jobs reading */
    char *tls_ca_certfile;             /* TLS CA Certificate File */
    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
    char *tls_certfile;                /* TLS Client Certificate File */
@@ -397,8 +397,8 @@ public:
    utime_t MaxDiffInterval;           /* Maximum time interval between Diffs */
    utime_t DuplicateJobProximity;     /* Permitted time between duplicicates */
    int64_t spool_size;                /* Size of spool file for this job */
-   uint32_t MaxConcurrentJobs;        /* Maximum concurrent jobs */
-   uint32_t NumConcurrentJobs;        /* number of concurrent jobs running */
+   int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
+   int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
    bool allow_mixed_priority;         /* Allow jobs with higher priority \
concurrently with this */  
    MSGS      *messages;               /* How and where to send messages */
diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c
index c324d45..68febb4 100644
--- a/bacula/src/dird/jobq.c
+++ b/bacula/src/dird/jobq.c
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2003-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2003-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -56,7 +56,6 @@ extern "C" void *sched_wait(void *arg);
 static int  start_server(jobq_t *jq);
 static bool acquire_resources(JCR *jcr);
 static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je);
-static void dec_read_store(JCR *jcr);
 static void dec_write_store(JCR *jcr);
 
 /*
@@ -710,7 +709,7 @@ static bool acquire_resources(JCR *jcr)
  *   but we do not really have enough information here to
  *   know if this is really a deadlock (it may be a dual drive
  *   autochanger), and in principle, the SD reservation system
- *   should detect these deadlocks, so push the work off on is.
+ *   should detect these deadlocks, so push the work off on it.
  */
 #ifdef xxx
    if (jcr->rstore && jcr->rstore == jcr->wstore) {    /* possible deadlock */
@@ -723,11 +722,7 @@ static bool acquire_resources(JCR *jcr)
 #endif
    if (jcr->rstore) {
       Dmsg1(200, "Rstore=%s\n", jcr->rstore->name());
-      if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs) {
-         jcr->rstore->NumConcurrentReadJobs++;
-         jcr->rstore->NumConcurrentJobs++;
-         Dmsg1(200, "Inc rncj=%d\n", jcr->rstore->NumConcurrentJobs);
-      } else {
+      if (!inc_read_store(jcr)) {
          Dmsg1(200, "Fail rncj=%d\n", jcr->rstore->NumConcurrentJobs);
          set_jcr_job_status(jcr, JS_WaitStoreRes);
          return false;
@@ -776,12 +771,34 @@ static bool acquire_resources(JCR *jcr)
    return true;
 }
 
-static void dec_read_store(JCR *jcr)
+static pthread_mutex_t rstore_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* 
+ * Note: inc_read_store() and dec_read_store() are
+ *   called from select_rstore() in src/dird/restore.c
+ */
+bool inc_read_store(JCR *jcr)
+{
+   P(rstore_mutex);
+   if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs) {
+      jcr->rstore->NumConcurrentReadJobs++;
+      jcr->rstore->NumConcurrentJobs++;
+      Dmsg1(200, "Inc rncj=%d\n", jcr->rstore->NumConcurrentJobs);
+      V(rstore_mutex);
+      return true;
+   }
+   V(rstore_mutex);
+   return false;
+}
+
+void dec_read_store(JCR *jcr)
 {
    if (jcr->rstore) {
+      P(rstore_mutex);
       jcr->rstore->NumConcurrentReadJobs--;    /* back out rstore */
       jcr->rstore->NumConcurrentJobs--;        /* back out rstore */
       Dmsg1(200, "Dec rncj=%d\n", jcr->rstore->NumConcurrentJobs);
+      V(rstore_mutex);
       ASSERT(jcr->rstore->NumConcurrentReadJobs >= 0);
       ASSERT(jcr->rstore->NumConcurrentJobs >= 0);
    }
diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h
index 33e12cf..06eeb3d 100644
--- a/bacula/src/dird/protos.h
+++ b/bacula/src/dird/protos.h
@@ -144,6 +144,10 @@ extern void cancel_storage_daemon_job(JCR *jcr);
 extern bool run_console_command(JCR *jcr, const char *cmd);
 extern void sd_msg_thread_send_signal(JCR *jcr, int sig);
 
+/* jobq.c */
+extern bool inc_read_store(JCR *jcr);
+extern void dec_read_store(JCR *jcr);
+
 /* migration.c */
 extern bool do_migration(JCR *jcr);
 extern bool do_migration_init(JCR *jcr);
diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c
index c804a3d..12bfc6a 100644
--- a/bacula/src/dird/pythondir.c
+++ b/bacula/src/dird/pythondir.c
@@ -202,7 +202,7 @@ PyObject *job_getattr(PyObject *self, char *attrname)
       buf[1] = 0;
       buf[0] = jcr->FDJobStatus;
       return Py_BuildValue((char *)getvars[i].fmt, buf);
-   case 29:                           /* SDJobStatus */
+   case 20:                           /* SDJobStatus */
       buf[1] = 0;
       buf[0] = jcr->SDJobStatus;
       return Py_BuildValue((char *)getvars[i].fmt, buf);
diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c
index e852edf..64ecadf 100644
--- a/bacula/src/dird/restore.c
+++ b/bacula/src/dird/restore.c
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -42,7 +42,6 @@
  *       to do the restore.
  *     Update the DB according to what files where restored????
  *
- *   Version $Id$
  */
 
 
@@ -119,7 +118,7 @@ struct bootstrap_info
  * it should be used for next operations, and need to be closed
  * at the end.
  */
-static bool open_bootstrap_file(JCR *jcr, struct bootstrap_info &info)
+static bool open_bootstrap_file(JCR *jcr, bootstrap_info &info)
 {
    FILE *bs;
    UAContext *ua;
@@ -205,7 +204,7 @@ static bool is_on_same_storage(JCR *jcr, char *new_one)
  * Returns true if we need to change the storage, and it set the new
  * Storage resource name in "storage" arg. 
  */
-static bool check_for_new_storage(JCR *jcr, struct bootstrap_info &info)
+static bool check_for_new_storage(JCR *jcr, bootstrap_info &info)
 {
    UAContext *ua = info.ua;
    parse_ua_args(ua);
@@ -229,7 +228,7 @@ static bool check_for_new_storage(JCR *jcr, struct bootstrap_info \
                &info)
  * Send bootstrap file to Storage daemon section by section.
  */
 static bool send_bootstrap_file(JCR *jcr, BSOCK *sock,
-                                struct bootstrap_info &info)
+                                bootstrap_info &info)
 {
    boffset_t pos;
    const char *bootstrap = "bootstrap\n";
@@ -257,36 +256,68 @@ static bool send_bootstrap_file(JCR *jcr, BSOCK *sock,
    return true;
 }
 
-/* 
+#define MAX_TRIES 6 * 360   /* 6 hours */
+
+/**
  * Change the read storage resource for the current job.
  */
-static void select_rstore(JCR *jcr, struct bootstrap_info &info)
+static bool select_rstore(JCR *jcr, bootstrap_info &info)
 {
    USTORE ustore;
+   int i;
+
    if (!strcmp(jcr->rstore->name(), info.storage)) {
-      return;
+      return true;                 /* same SD nothing to change */
    }
 
    if (!(ustore.store = (STORE *)GetResWithName(R_STORAGE,info.storage))) {
       Jmsg(jcr, M_FATAL, 0,
            _("Could not get storage resource '%s'.\n"), info.storage);
       set_jcr_job_status(jcr, JS_ErrorTerminated);
-      return;
+      return false;
    }
    
+   /*
+    * What does this do???????????  KES
+    */
    if (jcr->store_bsock) {
       jcr->store_bsock->destroy();
       jcr->store_bsock = NULL;
    }
    
+   /*
+    * release current read storage and get a new one 
+    */
+   dec_read_store(jcr);
    free_rstorage(jcr);
    set_rstorage(jcr, &ustore);
+   set_jcr_job_status(jcr, JS_WaitSD);
+   /*
+    * Wait for up to 6 hours to increment read stoage counter 
+    */
+   for (i=0; i < MAX_TRIES; i++) {
+      /* try to get read storage counter incremented */
+      if (inc_read_store(jcr)) {
+         set_jcr_job_status(jcr, JS_Running);
+         return true;
+      }
+      bmicrosleep(10, 0);       /* sleep 10 secs */
+      if (job_canceled(jcr)) {
+         free_rstorage(jcr);
+         return false;
+      }
+   }
+   /* Failed to inc_read_store() */
+   free_rstorage(jcr);
+   Jmsg(jcr, M_FATAL, 0, 
+      _("Could not acquire read storage lock for \"%s\""), info.storage);
+   return false;
 }
 
 /* 
- * Clean the struct bootstrap_info struct
+ * Clean the bootstrap_info struct
  */
-static void close_bootstrap_file(struct bootstrap_info &info)
+static void close_bootstrap_file(bootstrap_info &info)
 {
    if (info.bs) {
       fclose(info.bs);
@@ -303,12 +334,12 @@ static void close_bootstrap_file(struct bootstrap_info &info)
  */
 bool restore_bootstrap(JCR *jcr)
 {
-   BSOCK *fd=NULL, *sd;
-   bool end_loop=false;
-   bool first_time=true;
-   struct bootstrap_info info;
+   BSOCK *fd = NULL, *sd;
+   bool end_loop = false;
+   bool first_time = true;
+   bootstrap_info info;
    POOL_MEM restore_cmd(PM_MESSAGE);
-   bool ret=false;
+   bool ret = false;
 
    /* this command is used for each part */
    build_restore_command(jcr, restore_cmd);
@@ -318,7 +349,9 @@ bool restore_bootstrap(JCR *jcr)
    }
    while (!end_loop && !feof(info.bs)) {
       
-      select_rstore(jcr, info);
+      if (!select_rstore(jcr, info)) {
+         goto bail_out;
+      }
 
       /*
        * Open a message channel connection with the Storage
diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c
index 829382f..91a4318 100644
--- a/bacula/src/dird/ua_cmds.c
+++ b/bacula/src/dird/ua_cmds.c
@@ -458,10 +458,10 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
    for (i=1; i<ua->argc; i++) {
       if (strcasecmp(ua->argk[i], NT_("jobid")) == 0) {
          uint32_t JobId;
-         if (!ua->argv[i]) {
+         JobId = str_to_int64(ua->argv[i]);
+         if (!JobId) {
             break;
          }
-         JobId = str_to_int64(ua->argv[i]);
          if (!(jcr=get_jcr_by_id(JobId))) {
             ua->error_msg(_("JobId %s is not running. Use Job name to cancel \
inactive jobs.\n"),  ua->argv[i]);  return 1;
diff --git a/bacula/src/findlib/Makefile.in b/bacula/src/findlib/Makefile.in
index 7c4ad8a..fc2ac3c 100644
--- a/bacula/src/findlib/Makefile.in
+++ b/bacula/src/findlib/Makefile.in
@@ -78,7 +78,7 @@ uninstall-includes:
 
 libtool-install: all
 	$(MKDIR) $(DESTDIR)$(libdir)
-	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacfind$(DEFAULT_ARCHIVE_TYPE) \
$(DESTDIR)$(libdir) +	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) \
libbacfind$(DEFAULT_ARCHIVE_TYPE) $(DESTDIR)$(libdir)  
 libtool-uninstall:
 	$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacfind.la
diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c
index 3cdd8e0..f95c8ed 100644
--- a/bacula/src/findlib/find.c
+++ b/bacula/src/findlib/find.c
@@ -191,9 +191,14 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT \
*ff_pkt, bool to  ff->fstypes = fo->fstype;
             ff->drivetypes = fo->drivetype;
             bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
-            bstrncat(ff->AccurateOpts, fo->AccurateOpts, sizeof(ff->AccurateOpts));
-            bstrncat(ff->BaseJobOpts, fo->BaseJobOpts, sizeof(ff->BaseJobOpts));
+            if (fo->AccurateOpts[0]) {
+               bstrncpy(ff->AccurateOpts, fo->AccurateOpts, \
sizeof(ff->AccurateOpts)); +            }
+            if (fo->BaseJobOpts[0]) {
+               bstrncpy(ff->BaseJobOpts, fo->BaseJobOpts, sizeof(ff->BaseJobOpts));
+            }
          }
+         Dmsg3(50, "Verify=<%s> Accurate=<%s> BaseJob=<%s>\n", ff->VerifyOpts, \
ff->AccurateOpts, ff->BaseJobOpts);  dlistString *node;
          foreach_dlist(node, &incexe->name_list) {
             char *fname = node->c_str();
diff --git a/bacula/src/lib/Makefile.in b/bacula/src/lib/Makefile.in
index 1379f9d..4d41a10 100644
--- a/bacula/src/lib/Makefile.in
+++ b/bacula/src/lib/Makefile.in
@@ -198,9 +198,9 @@ uninstall-includes:
 
 libtool-install: all
 	$(MKDIR) $(DESTDIR)$(libdir)
-	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
-	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
-	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
+	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbac.la $(DESTDIR)$(libdir)
+	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbaccfg.la $(DESTDIR)$(libdir)
+	$(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbacpy.la $(DESTDIR)$(libdir)
 
 libtool-uninstall:
 	$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c
index 266f6e2..04bec30 100644
--- a/bacula/src/lib/jcr.c
+++ b/bacula/src/lib/jcr.c
@@ -1152,11 +1152,11 @@ void dbg_print_jcr(FILE *fp)
       return;
    }
 
-   fprintf(fp, "Attempt to dump current JCRs\n");
+   fprintf(fp, "Attempt to dump current JCRs. njcrs=%d\n", jcrs->size());
 
    for (JCR *jcr = (JCR *)jcrs->first(); jcr ; jcr = (JCR *)jcrs->next(jcr)) {
-      fprintf(fp, "JCR=%p JobId=%d name=%s JobStatus=%c\n", 
-              jcr, (int)jcr->JobId, jcr->Job, jcr->JobStatus);
+      fprintf(fp, "threadid=%p JobId=%d JobStatus=%c jcr=%p name=%s\n", 
+              (void *)jcr->my_thread_id, (int)jcr->JobId, jcr->JobStatus, jcr, \
jcr->Job);  fprintf(fp, "\tuse_count=%i\n", jcr->use_count());
       fprintf(fp, "\tJobType=%c JobLevel=%c\n",
               jcr->getJobType(), jcr->getJobLevel());
diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c
index 6d951e2..e403ec9 100644
--- a/bacula/src/lib/message.c
+++ b/bacula/src/lib/message.c
@@ -89,6 +89,30 @@ const char *host_os = HOST_OS;
 const char *distname = DISTNAME;
 const char *distver = DISTVER;
 
+/* Some message class methods */
+void MSGS::lock()
+{
+   P(fides_mutex);
+}
+
+void MSGS::unlock()
+{
+   V(fides_mutex);
+}
+
+/*
+ * Wait for not in use variable to be clear
+ */
+void MSGS::wait_not_in_use()     /* leaves fides_mutex set */
+{
+   lock();
+   while (m_in_use) {
+      unlock();
+      bmicrosleep(0, 200);         /* wait */
+      lock();
+   }
+}
+
 /*
  * Handle message delivery errors
  */
@@ -300,6 +324,7 @@ init_msg(JCR *jcr, MSGS *msg)
       daemon_msgs->dest_chain = temp_chain;
       memcpy(daemon_msgs->send_msg, msg->send_msg, sizeof(msg->send_msg));
    }
+
    Dmsg2(250, "Copy message resource %p to %p\n", msg, temp_chain);
 
 }
@@ -468,7 +493,15 @@ void close_msg(JCR *jcr)
    if (msgs == NULL) {
       return;
    }
-   P(fides_mutex);
+
+   /* Wait for item to be not in use, then mark closing */
+   if (msgs->is_closing()) {
+      return;
+   }
+   msgs->wait_not_in_use();          /* leaves fides_mutex set */
+   msgs->set_closing();
+   msgs->unlock();
+
    Dmsg1(850, "===Begin close msg resource at %p\n", msgs);
    cmd = get_pool_memory(PM_MESSAGE);
    for (d=msgs->dest_chain; d; ) {
@@ -552,12 +585,13 @@ rem_temp_file:
       }
       d = d->next;                    /* point to next buffer */
    }
-   V(fides_mutex);
    free_pool_memory(cmd);
    Dmsg0(850, "Done walking message chain.\n");
    if (jcr) {
       free_msgs_res(msgs);
       msgs = NULL;
+   } else {
+      msgs->clear_closing();
    }
    Dmsg0(850, "===End close msg resource\n");
 }
@@ -697,6 +731,18 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char \
*msg)  if (msgs == NULL) {
        msgs = daemon_msgs;
     }
+    /*
+     * If closing this message resource, print and send to syslog,
+     *   then get out.
+     */
+    if (msgs->is_closing()) {
+       fputs(dt, stdout);
+       fputs(msg, stdout);
+       fflush(stdout);
+       syslog(LOG_DAEMON|LOG_ERR, "%s", msg);
+       return;
+    }
+
     for (d=msgs->dest_chain; d; d=d->next) {
        if (bit_is_set(type, d->msg_types)) {
           switch (d->dest_code) {
@@ -778,7 +824,10 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char \
*msg)  case MD_MAIL_ON_ERROR:
              case MD_MAIL_ON_SUCCESS:
                 Dmsg1(850, "MAIL for following msg: %s", msg);
-                P(fides_mutex);
+                if (msgs->is_closing()) {
+                   break;
+                }
+                msgs->set_in_use();
                 if (!d->fd) {
                    POOLMEM *name = get_pool_memory(PM_MESSAGE);
                    make_unique_mail_filename(jcr, name, d);
@@ -799,7 +848,7 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char \
*msg)  d->max_len = len;      /* keep max line length */
                 }
                 fputs(msg, d->fd);
-                V(fides_mutex);
+                msgs->clear_in_use();
                 break;
              case MD_APPEND:
                 Dmsg1(850, "APPEND for following msg: %s", msg);
@@ -809,9 +858,12 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char \
*msg)  Dmsg1(850, "FILE for following msg: %s", msg);
                 mode = "w+b";
 send_to_file:
-                P(fides_mutex);
+                if (msgs->is_closing()) {
+                   break;
+                }
+                msgs->set_in_use();
                 if (!d->fd && !open_dest_file(jcr, d, mode)) {
-                   V(fides_mutex);
+                   msgs->clear_in_use();
                    break;
                 }
                 fputs(dt, d->fd);
@@ -825,7 +877,7 @@ send_to_file:
                       fputs(msg, d->fd);
                    }
                 }
-                V(fides_mutex);
+                msgs->clear_in_use();
                 break;
              case MD_DIRECTOR:
                 Dmsg1(850, "DIRECTOR for following msg: %s", msg);
diff --git a/bacula/src/lib/parse_conf.h b/bacula/src/lib/parse_conf.h
index c4711ed..2d84752 100644
--- a/bacula/src/lib/parse_conf.h
+++ b/bacula/src/lib/parse_conf.h
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -29,8 +29,6 @@
  *
  *     Kern Sibbald, January MM
  *
- *   Version $Id$
- *
  */
 
 struct RES_ITEM;                    /* Declare forward referenced structure */
@@ -137,8 +135,22 @@ public:
    DEST *dest_chain;                  /* chain of destinations */
    char send_msg[nbytes_for_bits(M_MAX+1)];  /* bit array of types */
 
+private:
+   bool m_in_use;                     /* set when using to send a message */
+   bool m_closing;                    /* set when closing message resource */
+
+public:
    /* Methods */
    char *name() const;
+   void clear_in_use() { lock(); m_in_use=false; unlock(); }
+   void set_in_use() { wait_not_in_use(); m_in_use=true; unlock(); }
+   void set_closing() { m_closing=true; }
+   void clear_closing() { lock(); m_closing=false; unlock(); }
+   bool is_closing() { lock(); bool rtn=m_closing; unlock(); return rtn; }
+
+   void wait_not_in_use();            /* in message.c */
+   void lock();                       /* in message.c */
+   void unlock();                     /* in message.c */
 };
 
 inline char *MSGS::name() const { return hdr.name; }
diff --git a/bacula/src/lib/plugins.c b/bacula/src/lib/plugins.c
index a0af158..7b7d324 100644
--- a/bacula/src/lib/plugins.c
+++ b/bacula/src/lib/plugins.c
@@ -121,6 +121,8 @@ bool load_plugins(void *binfo, void *bfuncs, const char \
*plugin_dir,  }
    entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 1000);
    for ( ;; ) {
+      plugin = NULL;            /* Start from a fresh plugin */
+
       if ((readdir_r(dp, entry, &result) != 0) || (result == NULL)) {
          if (!found) {
             Jmsg(NULL, M_WARNING, 0, _("Failed to find any plugins in %s\n"), 
diff --git a/bacula/src/qt-console/make-win32 b/bacula/src/qt-console/make-win32
index 3360e34..b75ff17 100755
--- a/bacula/src/qt-console/make-win32
+++ b/bacula/src/qt-console/make-win32
@@ -12,7 +12,7 @@ if test -e ../config.h.orig ; then
    mv -f ../config.h.orig ../config.h
 fi
 if test -d ../win32/release32; then
-   cp -f release/bat.exe ../win32/release32
+   cp -f debug/bat.exe ../win32/release32
    cp -f ${DEPKGS}/depkgs-mingw32/lib/qt/QtGui4.dll ../win32/release32
    cp -f ${DEPKGS}/depkgs-mingw32/lib/qt/QtCore4.dll ../win32/release32
    rm -rf ../win32/release32/help
diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c
index 40e0f2f..0411704 100644
--- a/bacula/src/stored/reserve.c
+++ b/bacula/src/stored/reserve.c
@@ -828,7 +828,7 @@ static bool reserve_device_for_append(DCR *dcr, RCTX &rctx)
    if (dev->can_read()) {
       Mmsg(jcr->errmsg, _("3603 JobId=%u device %s is busy reading.\n"), 
          jcr->JobId, dev->print_name());
-      Dmsg1(dbglvl, "%s", jcr->errmsg);
+      Dmsg1(dbglvl, "Failed: %s", jcr->errmsg);
       queue_reserve_message(jcr);
       goto bail_out;
    }
@@ -837,7 +837,7 @@ static bool reserve_device_for_append(DCR *dcr, RCTX &rctx)
    if (dev->is_device_unmounted()) {
       Mmsg(jcr->errmsg, _("3604 JobId=%u device %s is BLOCKED due to user \
unmount.\n"),   jcr->JobId, dev->print_name());
-      Dmsg1(dbglvl, "%s", jcr->errmsg);
+      Dmsg1(dbglvl, "Failed: %s", jcr->errmsg);
       queue_reserve_message(jcr);
       goto bail_out;
    }
@@ -875,9 +875,8 @@ static int is_pool_ok(DCR *dcr)
 "3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" nreserve=%d on drive %s.\n"), 
             (uint32_t)jcr->JobId, dcr->pool_name, dev->pool_name,
             dev->num_reserved(), dev->print_name());
+      Dmsg1(dbglvl, "Failed: %s", jcr->errmsg);
       queue_reserve_message(jcr);
-      Dmsg2(dbglvl, "failed: busy num_writers=0, reserved, pool=%s wanted=%s\n",
-         dev->pool_name, dcr->pool_name);
    }
    return 0;
 }
@@ -898,8 +897,8 @@ static bool is_max_jobs_ok(DCR *dcr)
       /* Max Concurrent Jobs depassed or already reserved */
       Mmsg(jcr->errmsg, _("3609 JobId=%u Max concurrent jobs exceeded on drive \
%s.\n"),   (uint32_t)jcr->JobId, dev->print_name());
+      Dmsg1(dbglvl, "Failed: %s", jcr->errmsg);
       queue_reserve_message(jcr);
-      Dmsg1(dbglvl, "reserve dev failed: %s", jcr->errmsg);
       return false;
    }
    if (strcmp(dcr->VolCatInfo.VolCatStatus, "Recycle") == 0) {
@@ -910,8 +909,8 @@ static bool is_max_jobs_ok(DCR *dcr)
       /* Max Job Vols depassed or already reserved */
       Mmsg(jcr->errmsg, _("3610 JobId=%u Volume max jobs exceeded on drive %s.\n"), 
             (uint32_t)jcr->JobId, dev->print_name());
-      queue_reserve_message(jcr);
       Dmsg1(dbglvl, "reserve dev failed: %s", jcr->errmsg);
+      queue_reserve_message(jcr);
       return false;                /* wait */
    }
    return true;
@@ -960,9 +959,9 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx)
          } else {
             Dmsg1(dbglvl, "not low use num_writers=%d\n", \
dev->num_writers+dev->num_reserved());  }
-         Dmsg0(dbglvl, "failed: !prefMnt && busy.\n");
          Mmsg(jcr->errmsg, _("3605 JobId=%u wants free drive but device %s is \
busy.\n"),   jcr->JobId, dev->print_name());
+         Dmsg1(dbglvl, "Failed: %s", jcr->errmsg);
          queue_reserve_message(jcr);
          return 0;
       }
@@ -971,8 +970,8 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx)
       if (rctx.PreferMountedVols && !dev->vol && dev->is_tape()) {
          Mmsg(jcr->errmsg, _("3606 JobId=%u prefers mounted drives, but drive %s has \
no Volume.\n"),   jcr->JobId, dev->print_name());
+         Dmsg1(dbglvl, "Failed: %s", jcr->errmsg);
          queue_reserve_message(jcr);
-         Dmsg0(dbglvl, "failed: want mounted -- no vol\n");
          return 0;                 /* No volume mounted */
       }
 
@@ -1056,7 +1055,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx)
    Mmsg(jcr->errmsg, _("3911 JobId=%u failed reserve drive %s.\n"), 
          jcr->JobId, dev->print_name());
    queue_reserve_message(jcr);
-   Dmsg1(dbglvl, "failed: No reserve %s\n", dev->print_name());
+   Dmsg1(dbglvl, "Failed: No reserve %s\n", dev->print_name());
    return 0;
 }
 
diff --git a/bacula/src/stored/vol_mgr.c b/bacula/src/stored/vol_mgr.c
index 179ffef..6c6231b 100644
--- a/bacula/src/stored/vol_mgr.c
+++ b/bacula/src/stored/vol_mgr.c
@@ -621,10 +621,6 @@ bool free_volume(DEVICE *dev)
    if (!vol->is_swapping()) {
       Dmsg1(dbglvl, "=== clear in_use vol=%s\n", vol->vol_name);
       dev->vol = NULL;
-      if (!dev->num_reserved()) {
-         dev->pool_name[0] = 0;
-         dev->pool_type[0] = 0;
-      }
       vol_list->remove(vol);
       Dmsg2(dbglvl, "=== remove volume %s dev=%s\n", vol->vol_name, \
dev->print_name());  free_vol_item(vol);
diff --git a/bacula/src/tray-monitor/tray-monitor.c \
b/bacula/src/tray-monitor/tray-monitor.c index dd5d664..cd80b12 100644
--- a/bacula/src/tray-monitor/tray-monitor.c
+++ b/bacula/src/tray-monitor/tray-monitor.c
@@ -1078,7 +1078,7 @@ void trayMessage(const char *fmt,...)
    bvsnprintf(buf, sizeof(buf), (char *)fmt, arg_ptr);
    va_end(arg_ptr);
 
-   fprintf(stderr, buf);
+   fprintf(stderr, "%s", buf);
 
 // gtk_tray_icon_send_message(gtk_status_icon_get_tray_icon(mTrayIcon), 5000, (const \
char*)&buf, -1);  }
diff --git a/bacula/src/version.h b/bacula/src/version.h
index 4ef4519..a730c17 100644
--- a/bacula/src/version.h
+++ b/bacula/src/version.h
@@ -38,23 +38,23 @@
 /* Shared object library versions */
 #define LIBBAC_LT_CURRENT  5
 #define LIBBAC_LT_REVISION 0
-#define LIBBAC_LT_AGE 1
+#define LIBBAC_LT_AGE 2
 
 #define LIBBACCFG_LT_CURRENT 5
 #define LIBBACCFG_LT_REVISION 0
-#define LIBBACCFG_LT_AGE 1
+#define LIBBACCFG_LT_AGE 2
 
 #define LIBBACPY_LT_CURRENT 5
 #define LIBBACPY_LT_REVISION 0
-#define LIBBACPY_LT_AGE 1
+#define LIBBACPY_LT_AGE 2
 
 #define LIBBACSQL_LT_CURRENT 5
 #define LIBBACSQL_LT_REVISION 0
-#define LIBBACSQL_LT_AGE 1
+#define LIBBACSQL_LT_AGE 2
 
 #define LIBBACFIND_LT_CURRENT 5
 #define LIBBACFIND_LT_REVISION 0
-#define LIBBACFIND_LT_AGE 1
+#define LIBBACFIND_LT_AGE 2
 
 
 
diff --git a/bacula/src/win32/libwin32/service.cpp \
b/bacula/src/win32/libwin32/service.cpp index c77f8e2..c34de5a 100644
--- a/bacula/src/win32/libwin32/service.cpp
+++ b/bacula/src/win32/libwin32/service.cpp
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2007-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -29,8 +29,6 @@
  * 
  *  Kern Sibbald, August 2007
  *
- *  Version $Id$
- *
  * This is a generic service routine, which is used by all three
  *  of the daemons. Each one compiles it with slightly different
  *  #defines.
@@ -363,8 +361,10 @@ int removeService()
                   }
                }
                if (status.dwCurrentState != SERVICE_STOPPED) {
-                  MessageBox(NULL, _("The Bacula service: " APP_NAME " could not be \
                stopped"), 
-                     APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+                  if (opt_debug) {
+                     MessageBox(NULL, _("The Bacula service: " APP_NAME " could not \
be stopped"),  +                        APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+                  }
                }
             }
 
@@ -381,9 +381,11 @@ int removeService()
             CloseServiceHandle(baculaService);
 
          } else {
-            MessageBox(NULL, _("A existing Bacula service: " APP_NAME " could not be \
                found for "
-                "removal. This is not normally an error."),
-                APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+            if (opt_debug) {
+               MessageBox(NULL, _("An existing Bacula service: " APP_NAME " could \
not be found for " +                   "removal. This is not normally an error."),
+                   APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+            }
          }
          CloseServiceHandle(serviceManager);
          return stat;
@@ -400,9 +402,11 @@ int removeService()
       if (RegOpenKey(HKEY_LOCAL_MACHINE, 
             "Software\\Microsoft\\Windows\\CurrentVersion\\RunServices",
             &runservices) != ERROR_SUCCESS) {
-         MessageBox(NULL, 
-            _("Could not find registry entry.\nService probably not registerd - the \
                Bacula service was not removed"), 
-               APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+         if (opt_debug) {
+            MessageBox(NULL, 
+               _("Could not find registry entry.\nService probably not registerd - \
the Bacula service was not removed"),  +                  APP_DESC, \
MB_ICONEXCLAMATION | MB_OK); +         }
       } else {
          /* Now delete the Bacula entry */
          if (RegDeleteValue(runservices, APP_NAME) != ERROR_SUCCESS) {
@@ -416,9 +420,11 @@ int removeService()
 
       /* Stop any running Bacula */
       if (!stopRunningBacula()) {
-         MessageBox(NULL,
-             _("Bacula could not be contacted, probably not running"),
-             APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+         if (opt_debug) {
+            MessageBox(NULL,
+                _("Bacula could not be contacted, probably not running"),
+                APP_DESC, MB_ICONEXCLAMATION | MB_OK);
+         }
          return 0;   /* not really an error */
       }
 
diff --git a/regress/tests/multi2-storage-test b/regress/tests/multi2-storage-test
index 3f2a418..ec55cf5 100755
--- a/regress/tests/multi2-storage-test
+++ b/regress/tests/multi2-storage-test
@@ -13,15 +13,15 @@ scripts/prepare-disk-changer
 # create a new bacula-sd.confs
 for i in 2 3 4; do
   perl -ne "\$i='$i';\$tmp='$tmp';"'
+  if (/Name =/ ) { $_ =~ s/-sd/-$i-sd/}
   if (/SDPort = /) { $_ =~ s/(\d+)/1810$i/}
-  if (/Name = /) { $_ =~ s/FileStorage/FileStorage$i/}
-  if (/mediatype = /) { $_ =~ s/FileMedia/FileMedia$1/}
+  if (/mediatype = /) { $_ =~ s/FileMedia/FileMedia$i/}
   if (/WorkingDirectory/) { $_ =~ s:working:tmp/$i:}
   if (/Pid Directory/) { $_ =~ s:working:tmp/$i:}
   if (/(Archive|Changer) Device/) { $_ =~ s:$tmp:$tmp/$i:}
   print;
   ' $conf/bacula-sd.conf > $conf/bacula-sd$i.conf
-  mkdir -p ${working}$i
+  mkdir -p ${tmp}/$i
   sed "s/bacula-sd.conf/bacula-sd${i}.conf/" $scripts/bacula-ctl-sd \
       > $tmp/bacula-ctl-sd$i
   chmod +x $tmp/bacula-ctl-sd$i
@@ -46,6 +46,18 @@ echo "${cwd}/build" >${cwd}/tmp/file-list
 change_jobname $JobName
 start_test
 
+# Stop SDs
+for sd in 2 3 4; do
+  $tmp/bacula-ctl-sd$sd stop &> /dev/null
+done
+
+sleep 2
+
+# Start SDs
+for sd in 2 3 4; do
+  $tmp/bacula-ctl-sd$sd start &> /dev/null
+done
+
 # Write out bconsole commands
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @out /dev/null
@@ -59,26 +71,25 @@ label storage=File4 volume=File4-Vol001 Pool=Default
 run job=$JobName storage=tape yes
 wait
 messages
+@exec "touch $cwd/build/po/fr.po"
 run job=$JobName storage=File yes
 wait
 messages
+@exec "touch $cwd/build/po/de.po"
 run job=$JobName storage=File2 yes
 wait
 messages
+@exec "touch $cwd/build/po/it.po"
 run job=$JobName storage=File3 yes
 wait
 messages
+@exec "touch $cwd/build/po/es.po"
 run job=$JobName storage=File4 yes
 wait
 messages
 quit
 END_OF_DATA
 
-# Start SDs
-for sd in 2 3 4; do
-  $tmp/bacula-ctl-sd$sd start &> /dev/null
-done
-
 run_bacula
 
 echo "ficheriro1.txt" >${cwd}/build/po/ficheriro1.txt
@@ -90,27 +101,60 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 messages
 @$out ${cwd}/tmp/log1.out
 @# Force Incremental on the second Volume
+@exec "touch $cwd/build/po/fi.po"
 run level=Incremental storage=File job=$JobName yes
 wait
 messages
+@exec "touch $cwd/build/po/uk.po"
 run level=Incremental storage=File2 job=$JobName yes
 wait
 messages
+@exec "touch $cwd/build/po/sv.po $cwd/build/po/test.po"
 run level=Incremental storage=File3 job=$JobName yes
 wait
 messages
+@exec "touch $cwd/build/po/README"
 run level=Incremental storage=File4 job=$JobName yes
 wait
 messages
 @# 
 @# now do a restore
 @#
-@$out ${cwd}/tmp/log2.out
+@$out ${cwd}/tmp/log22.out
 setdebug trace=1 level=110 client
 setdebug trace=1 level=110 director
 restore where=${cwd}/tmp/bacula-restores select all done yes
 wait
 messages
+@$out ${cwd}/tmp/status.out
+status all
+@exec "touch $cwd/build/po/POTFILES"
+@$out ${cwd}/tmp/log1.out
+run level=Incremental storage=File4 job=$JobName yes
+wait
+messages
+@# run a job that will wait for a volume
+@$out ${cwd}/tmp/log23.out
+@exec "touch $cwd/build/po/ChangeLog"
+run level=Incremental pool=Special storage=File3 job=$JobName yes
+@sleep 5
+messages
+status dir
+status storage=File3
+@sleep 3
+@# 
+@# now do a restore with a backup that takes a drive
+@#
+setdebug trace=1 level=110 client
+setdebug trace=1 level=110 director
+restore where=${cwd}/tmp/bacula-restores select all done yes
+@sleep 10
+messages
+status dir
+label storage=File3 volume=test3 pool=Special
+mount storage=File3
+wait
+messages
 show storage
 sql
 select * FROM Storage;
@@ -122,6 +166,9 @@ END_OF_DATA
 run_bconsole
 
 check_for_zombie_jobs storage=File
+check_for_zombie_jobs storage=File2
+check_for_zombie_jobs storage=File3
+check_for_zombie_jobs storage=File4
 check_for_zombie_jobs storage=tape
 
 stop_bacula
@@ -129,7 +176,12 @@ for sd in 2 3 4; do
   $tmp/bacula-ctl-sd$sd stop &> /dev/null
 done
 
+# we have two restore to test
+cp $tmp/log22.out $tmp/log2.out
+check_two_logs
+cp $tmp/log23.out $tmp/log2.out
 check_two_logs
+
 check_restore_diff
 
 end_test


hooks/post-receive
-- 
Bacula

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Bacula-commits mailing list
Bacula-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic