Hello,

The following patch *should* fix the problem. It is for 1.38.9. The
instructions are at the top of the patch.

> Just a FYI to the list: 'label barcodes' has unexpected behavior if you
> assign to a pool for which no DB record exists (as can happen if you add
> a new pool to bacula-dir.conf without restarting the director). In this
> case it decides the tape is a cleaning tape. This is completely
> independent of the 'Cleaning Prefix' directive.
>
> Excerpt from 'label barcodes' output:
>
>         3301 Issuing autochanger "loaded drive 0" command.
>         3302 Autochanger "loaded drive 0", result: nothing loaded.
>         3306 Issuing autochanger "list" command.
>         The following Volumes will be labeled:
>         Slot  Volume
>         ==============
>            1  A00001
>            2  A00002
>            3  A00003
>            4  A00004
>            5  A00005
>            6  A00006
>            7  A00007
>         Do you want to continue? (y/n): y
>         Defined Pools:
>              1: IncDiff
>              2: Full
>              3: Default
>              4: Scratch
>         Select the Pool (1-4): 4
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00001" successfully created.
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00002" successfully created.
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00003" successfully created.
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00004" successfully created.
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00005" successfully created.
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00006" successfully created.
>         Pool "Scratch" resource not found!
>         Catalog record for cleaning tape "A00007" successfully created.
>         *
>
> As this puzzled me until I looked at the code for
> is_cleaning_tape in ua_label.c, I thought I'd post this to the list for
> posterity.
>
> --
> Tod Hagan
> AIRMAP/Climate Change Research Center
> Institute for the Study of Earth, Oceans, and Space
> University of New Hampshire
> Durham, NH 03824
> Phone: 603-862-3116
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>


Best regards, Kern
This patch should fix the bug that caused all Volumes to
be treated as cleaning tapes during a 'label barcodes' when
the resource for the volume is not found.

Index: src/dird/ua_label.c
===================================================================
RCS file: /cvsroot/bacula/bacula/src/dird/ua_label.c,v
retrieving revision 1.58.2.9
diff -u -u -b -r1.58.2.9 ua_label.c
--- src/dird/ua_label.c	2 May 2006 14:48:15 -0000	1.58.2.9
+++ src/dird/ua_label.c	30 May 2006 08:57:33 -0000
@@ -953,8 +953,9 @@
    /* Find Pool resource */
    ua->jcr->pool = (POOL *)GetResWithName(R_POOL, pr->Name);
    if (!ua->jcr->pool) {
-      bsendmsg(ua, _("Pool \"%s\" resource not found!\n"), pr->Name);
-      return true;
+      bsendmsg(ua, _("Pool \"%s\" resource not found for volume \"%s\"!\n"),
+         pr->Name, mr->VolumeName);
+      return false;
    }
    if (ua->jcr->pool->cleaning_prefix == NULL) {
       return false;
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to