Amanda-Users

Re: HELLO, I have trouble with chg-scsi: wrong emubarcode number

2003-07-25 13:06:35
Subject: Re: HELLO, I have trouble with chg-scsi: wrong emubarcode number
From: Jon LaBadie <jon AT jgcomp DOT com>
To: amanda-users <amanda-users AT amanda DOT org>
Date: Fri, 25 Jul 2003 13:04:25 -0400
On Fri, Jul 25, 2003 at 12:32:50PM -0400, Ashwin Bijur wrote:
> 
> >I am experiencing a problem with chg-scsi.  Whenever I execute 
> >"chg-scsi -inventory", I get back the following response:
> > BarCode == 1 and emubarcode == 1

This is saying you are claiming to have a barcode reader and
asking chg-scsi to emulate one also.  Only one or the other
can be set to 1.

> >Our tape-changer is equipped with a bar code reader.  I have set 
> >"havebarcode 1", "emubarcode 0" in the chg-scsi.conf file.  But 
> >chg-scsi doesn't seem to pickup this information.  When I ran "strings 
> >-a /usr/local/etc/libexec/chg-scsi | grep emubarcode", I got the 
> >following output:
> >
> >emubarcode
> >emubarcode       1   # If you drive has no barcode reader this will try
> >BarCode == 1 and emubarcode == 1
> >emubarcode
> >
> >So it seems that emubarcode is hardcoded as 1 in the binary file.  Is 
> >there any way to fix this or force chg-scsi to read the value for 
> >emubarcode from the chg-scsi.conf file?

There is nothing in that grep output to suggest emubarcode is
hardcoded as 1;  == is a test, not an assignment.

> >When I run "chg-scsi -genconf", I get the following information:
  ...
> >emubarcode       1   # If you drive has no barcode reader this will try
> >                     # keep an inventory of your tapes to find them faster
> >                     #
> >havebarcode      0   # Set this to 1 if you have an library with an 

I peeked at the chg-scsi.c source code.  emubarcode is initialized to 0.

However, I did note an oddity in the part of the code that reads the
config file.  Where is detects "havebarcode", it uses the value,
0 or 1, that follows the configuration parameter.  This is as expected.

When "emubarcode" is detected it is treated differently.  It is treated
as a boolean and the value that follows is ignored.  I.e. if "emubarcode"
is in chg-scsi.conf, THEN it is set to 1 regardless of the value.

I suggest you try eliminating the emubarcode entirely from your
chg-scsi.conf file (still setting "havebarcode 1") and see if that
works.  It should pick-up the hardcoded emubarcode default of 0.
If that works, we can claim to the maintainers of the code that it
is a defect in the documentation or the source code.

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

<Prev in Thread] Current Thread [Next in Thread>