]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix mtx-changer to detect both versions of Ubuntu (Debian)
authorKern Sibbald <kern@sibbald.com>
Wed, 2 Jul 2008 20:49:44 +0000 (20:49 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 2 Jul 2008 20:49:44 +0000 (20:49 +0000)
     mt. This fixes bug #1116.
kes  Fix failure of 2drive-concurrent-test. Always read label;
     clear_unload() only after drive is defined in acquire_for_read().

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

bacula/scripts/mtx-changer.in
bacula/src/stored/acquire.c
bacula/src/stored/autochanger.c
bacula/src/stored/job.c
bacula/src/stored/label.c
bacula/src/stored/reserve.c
bacula/src/version.h
bacula/technotes-2.4

index 1dbc5b410f66dd3fcee010b28e7acf2675c945d4..7333bc5483b49c5fe6cccfde08088718ad3d8e0e 100644 (file)
@@ -55,6 +55,8 @@ MTX=@MTX@
 #  Note Debian has a different mt than the standard Linux version. 
 #    When no tape is in the drive it waits 2 minutes.  
 #    When a tape is in the drive, it prints user unfriendly output.
+#  Note, with Ubuntu Gusty (8.04), there are two versions of mt,
+#    so we attempt to figure out which one.
 #
 
 OS=`uname`
@@ -66,10 +68,12 @@ case ${OS} in
     ready="Current Driver State: at rest."
     ;;
   Linux)
-    if test -e /etc/debian_version ; then
-       ready="drive status"
-    else
-       ready="ONLINE"
+    ready="ONLINE"
+    if test -f /etc/debian_version ; then
+       mt --version|grep "mt-st" >/dev/null 2>&1
+       if test $? -eq 1 ; then
+         ready="drive status"
+       fi
     fi
   ;;
 esac
index 42f15bd7655cb48cf62840d6abf3693ea2d73da6..4af83a3343b45eaa1ae6cd16881380bc531f8b42 100644 (file)
@@ -70,7 +70,6 @@ bool acquire_device_for_read(DCR *dcr)
          dev->num_writers, jcr->JobId);
       goto get_out;
    }
-   dev->clear_unload();
 
    /* Find next Volume, if any */
    vol = jcr->VolList;
@@ -173,6 +172,8 @@ bool acquire_device_for_read(DCR *dcr)
       }
    }
 
+   dev->clear_unload();
+
    if (reserve_volume(dcr, dcr->VolumeName) == NULL) {
       Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName,
             dcr->dev->print_name());
index a8afe572c411b1d7b9146664c226b9955d11a83f..b00c64363216ee2450f3c585d19edd7d85943b49 100644 (file)
@@ -118,7 +118,7 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir)
    POOLMEM *changer;
 
    if (!dev->is_autochanger()) {
-      Dmsg0(100, "ChangerCommand=0, virtual disk changer\n");
+      Dmsg1(100, "Device %s is not an autochanger\n", dev->print_name());
       return 0;
    }
 
index e18d41c7eedbedab55f8c950d1ce8e3f687ace51..10443ceb5f9fe8070f47a5e91b2d5194c36d3d6a 100644 (file)
@@ -220,10 +220,14 @@ void handle_filed_connection(BSOCK *fd, char *job_name)
 {
    JCR *jcr;
 
-   bmicrosleep(0, 50000);             /* wait 50 millisecs */
+/*
+ * With the following bmicrosleep on, running the
+ * SD under the debugger fails.
+ */
+// bmicrosleep(0, 50000);             /* wait 50 millisecs */
    if (!(jcr=get_jcr_by_full_name(job_name))) {
       Jmsg1(NULL, M_FATAL, 0, _("FD connect failed: Job name not found: %s\n"), job_name);
-      Dmsg1(3, "**** Job \"%s\" not found", job_name);
+      Dmsg1(3, "**** Job \"%s\" not found\n", job_name);
       return;
    }
 
index da90a41fb0f626e900ed8c820377319f102afb03..e2b9f548ea89dde27a87343277a87dd14dd1dd3b 100644 (file)
@@ -85,6 +85,7 @@ int read_dev_volume_label(DCR *dcr)
          return VOL_IO_ERROR;
       }
    }
+#ifdef xxx
    if (dev->is_labeled()) {              /* did we already read label? */
       /* Compare Volume Names allow special wild card */
       if (VolName && *VolName && *VolName != '*' && strcmp(dev->VolHdr.VolumeName, VolName) != 0) {
@@ -104,6 +105,7 @@ int read_dev_volume_label(DCR *dcr)
       Dmsg0(130, "Leave read_volume_label() VOL_OK\n");
       return VOL_OK;       /* label already read */
    }
+#endif
 
    dev->clear_labeled();
    dev->clear_append();
index 929ba8e86a4ece2e2c480c01affa7fa2ad0f1f1a..adc3bfaa8580249c88671137ffebbf922471dd61 100644 (file)
@@ -1100,6 +1100,11 @@ int search_res_for_device(RCTX &rctx)
       if (strcmp(rctx.device_name, changer->hdr.name) == 0) {
          /* Try each device in this AutoChanger */
          foreach_alist(rctx.device, changer->device) {
+            if (!rctx.device->autoselect) {
+               Dmsg1(100, "Device %s not autoselect skipped.\n",
+                  rctx.device->hdr.name);
+               continue;              /* device is not available */
+            }
             Dmsg2(dbglvl, "jid=%u Try changer device %s\n", (int)rctx.jcr->JobId, 
                   rctx.device->hdr.name);
             stat = reserve_device(rctx);
index 9644e9706419daf2699a13ae6c3169abd98869a0..f2ce173d8c660e2e179f85254cba8a2639e9eacc 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "2.4.1-b1"
-#define BDATE   "01 July 2008"
-#define LSMDATE "01Jul08"
+#define VERSION "2.4.1-b2"
+#define BDATE   "02 July 2008"
+#define LSMDATE "02Jul08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index a5a579f4f43cb3f90fc05c6cb7eb764f71908a91..cee370406615dbf52c0036f2b4e797f43e33250c 100644 (file)
@@ -1,6 +1,12 @@
               Technical notes on version 2.4
 
 General:
+02Jul08
+kes  Fix mtx-changer to detect both versions of Ubuntu (Debian)
+     mt. This fixes bug #1116.
+kes  Fix failure of 2drive-concurrent-test. Always read label;
+     clear_unload() only after drive is defined in acquire_for_read().
+
 Release Beta version 2.4.1-b1
 01Jul08
 kes  Back out bad src/lib/base64.c change.