Thanks to those who offered help...

I have my L20 working on a Solaris 8 box with amanda 2.4.2p2.

I made a silly mistake.  I forgot to remove the -x flag from "#!/bin/sh"
after debugging chg-zd-mtx.  This was sending the first line of the
script, MT=/usr/bin/mt, to amlabel and amcheck.

There were only two changes that I needed to make in chg-zd-mtx.  First,
for Solaris, I need /usr/ucb in PATH before /usr/bin.  Otherwise "tr"
does not work as expected.  Secondly, I needed a small change in sed
since I have bar code capability, but am not using it.  The ".*" I added
near the end just gets rid of the "VolumeTag =" verbiage at the end of
the string.  This patch should still work with non bar-code-enabled
libraries, but I have not tested it.

There is one other patch I suggest be incorporated into the CVS.
chg-zd-mtx does not skip comment lines in the <changerfile>.  In fact,
it appends current values and commented out values to the variable
causing problems.  I saw a posting from John R. Jackson on 4/6/01 saying
'How about we do this "the shell way" and get rid of grep and awk
altogether?'  Sorry John, but I propose adding more awk to the script. :)

For those who asked what my configs look like, I'll include the
specifics below.



Patch 1: fix PATH for Solaris & fix sed for bar code enabled, but not used

***** start of diff, this line should be cut *****
*** chg-zd-mtx.orig     Thu Oct 18 12:32:42 2001
--- chg-zd-mtx  Thu Oct 18 12:32:35 2001
***************
*** 73,79 ****
  libexecdir=${exec_prefix}/libexec
  
  # try to hit all the possibilities here
! PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin
  export PATH
  
  USE_VERSION_SUFFIXES="no"
--- 73,79 ----
  libexecdir=${exec_prefix}/libexec
  
  # try to hit all the possibilities here
! PATH=$sbindir:$libexecdir:/usr/ucb/:/usr/bin:/usr/sbin:/sbin:/usr/local/bin
  export PATH
  
  USE_VERSION_SUFFIXES="no"
***************
*** 145,151 ****
                        sed -n "s/Data Transfer Element $drivenum:Empty/-1/p;s/Data 
Transfer Element $drivenum:Full (Storage Element \([1-9][0-9]*\) Loaded):VolumeTag = 
\(.*\)/\2/p"`
        else
                usedslot=`$MTX status |
!                       sed -n "s/Data Transfer Element:Empty/-1/p;s/Data Transfer 
Element:Full (Storage Element \([1-9][0-9]*\) Loaded)/\1/p;s/Data Transfer Element 
$drivenum:Empty/-1/p;s/Data Transfer Element $drivenum:Full (Storage Element 
\([1-9][0-9]*\) Loaded)/\1/p"`
        fi
  
        if [ "$usedslot" -eq "-1" ]; then
--- 145,151 ----
                        sed -n "s/Data Transfer Element $drivenum:Empty/-1/p;s/Data 
Transfer Element $drivenum:Full (Storage Element \([1-9][0-9]*\) Loaded):VolumeTag = 
\(.*\)/\2/p"`
        else
                usedslot=`$MTX status |
!                       sed -n "s/Data Transfer Element:Empty/-1/p;s/Data Transfer 
Element:Full (Storage Element \([1-9][0-9]*\) Loaded)/\1/p;s/Data Transfer Element 
$drivenum:Empty/-1/p;s/Data Transfer Element $drivenum:Full (Storage Element 
\([1-9][0-9]*\) Loaded).*/\1/p"`
        fi
  
        if [ "$usedslot" -eq "-1" ]; then
***** end of diff, this line should be cut *****



Patch 2: fix chg-zd-mtx to skip comment lines in <changerfile>

***** start of diff, this line should be cut *****
*** chg-zd-mtx.orig     Thu Oct 18 12:32:42 2001
--- chg-zd-mtx  Thu Oct 18 12:32:35 2001
***************
*** 120,133 ****
  
  #### Dig out of the config file what is needed
  
! firstslot=`cat $configfile | sed -n "s/firstslot=\([1-9][0-9]*\)\(.*\)/\1/p"`
! lastslot=`cat $configfile | sed -n "s/lastslot=\([1-9][0-9]*\)\(.*\)/\1/p"`
! cleanslot=`cat $configfile | sed -n "s/cleanslot=\([1-9][0-9]*\)\(.*\)/\1/p"`
! OFFLINE_BEFORE_UNLOAD=`cat $configfile | sed -n 
"s/OFFLINE_BEFORE_UNLOAD=\([0-9]\)\(.*\)/\1/p"`
! AUTOCLEAN=`cat $configfile | sed -n "s/AUTOCLEAN=\([0-9]\)\(.*\)/\1/p"`
! autocleancount=`cat $configfile | sed -n "s/autocleancount=\([0-9]\)\(.*\)/\1/p"`
! havereader=`cat $configfile | sed -n "s/havereader=\([0-9]\)\(.*\)/\1/p"`
! offlinestatus=`cat $configfile | sed -n "s/offlinestatus=\([0-9]\)\(.*\)/\1/p"`
  
  # Routines start here
  
--- 120,133 ----
  
  #### Dig out of the config file what is needed
  
! firstslot=`awk -F# '{print $1}' $configfile | sed -n 
"s/firstslot=\([1-9][0-9]*\)\(.*\)/\1/p"`
! lastslot=`awk -F# '{print $1}' $configfile | sed -n 
"s/lastslot=\([1-9][0-9]*\)\(.*\)/\1/p"`
! cleanslot=`awk -F# '{print $1}' $configfile | sed -n 
"s/cleanslot=\([1-9][0-9]*\)\(.*\)/\1/p"`
! OFFLINE_BEFORE_UNLOAD=`awk -F# '{print $1}' $configfile | sed -n 
"s/OFFLINE_BEFORE_UNLOAD=\([0-9]\)\(.*\)/\1/p"`
! AUTOCLEAN=`awk -F# '{print $1}' $configfile | sed -n 
"s/AUTOCLEAN=\([0-9]\)\(.*\)/\1/p"`
! autocleancount=`awk -F# '{print $1}' $configfile | sed -n 
"s/autocleancount=\([0-9]\)\(.*\)/\1/p"`
! havereader=`awk -F# '{print $1}' $configfile | sed -n 
"s/havereader=\([0-9]\)\(.*\)/\1/p"`
! offlinestatus=`awk -F# '{print $1}' $configfile | sed -n 
"s/offlinestatus=\([0-9]\)\(.*\)/\1/p"`
  
  # Routines start here
  
**** end of diff, this line should be cut ****



WARNING:
I use non-standard paths for amanda.  You will need to customize the
paths for your install.

Specifics for amanda.conf:
runtapes 1              # number of tapes to be used in a single run of amdump
tpchanger "chg-zd-mtx"  # the tape-changer glue script
tapedev "/dev/rmt/0hn"  # the no-rewind tape device to be used
rawtapedev "/dev/null"  # the raw device to be used (ftape only)
changerfile "/usr/local/amanda/config/off-site/chg-scsi"
changerdev "/dev/scsi/changer/c3t0d0"


chg-scsi.conf in its entirety:
firstslot=1             #### 1st tape slot
lastslot=19             #### Last tape slot
cleanslot=20             #### Slot with cleaner tape
#
#   # Do you want to clean the drive after a certain number of accesses?
#   # NOTE - This is unreliable, since 'accesses' aren't 'uses', and we
#   #        have no reliable way to count this. A single amcheck could
#   #        generate as many accesses as slots you have, plus 1.
#   # ALSO NOTE - many modern tape loaders handle this automatically.
#
AUTOCLEAN=0             #### Set to '1' or greater to enable
#
autocleancount=99       #### Number of access before a clean.
#
havereader=0            #### If you have a barcode reader, set to 1.
#
offlinestatus=0         #### Set to 0 if 'mt status' gives an
#                         #### "offline" when drive is offline.
#                         #### Set to 1 or greater if 'mt status'
#                         #### doesn't give and offline, rather an
#                         #### "ONLINE" when drive is online.
#
OFFLINE_BEFORE_UNLOAD=0 #### Does your tape driver require a
#                         #### 'mt offline' before mtx unload?
####

--donnie


> From: Donnie Emeson <[EMAIL PROTECTED]>
> Subject: changer problem
> To: [EMAIL PROTECTED]
> Date: Wed, 17 Oct 2001 22:16:42 -0600 (MDT)
> 
> I'm having trouble with amanda 2.4.2p2 and a new changer, a Sun L20 with
> 20 slots and one DLT8000.
> 
> This changer has a barcode reader, but I'm not using it.  (I don't have
> a label maker and don't really want to bother.)  Perhaps this is what's
> causing my problems...
> 
> I have chg-zd-mtx working, though I had to make some minor changes.
> 
> The problem is amlabel and amcheck.  Both get similar errors.  Amlabel
> goes ahead and loads the first tape and then gives me:
> amlabel: could not load slot "current": badly formed result from changer: 
>"MT=/usr/bin/mt"
> 
> Amcheck is fine except for this error:
> amcheck-server: could not get changer info: badly formed result from changer: 
>"MT=/usr/bin/mt"
> 
> 
> # cat /tmp/amanda/amlabel.20011017213837.debug 
> amlabel: debug 1 pid 27110 ruid 43382 euid 43382 start time Wed Oct 17 21:38:37 2001
> changer: got exit: 0 str: MT=/usr/bin/mt
> could not load slot "current": badly formed result from changer: "MT=/usr/bin/mt"
> amlabel: pid 27110 finish time Wed Oct 17 21:40:07 2001
> 
> 
> # cat /tmp/amanda/amcheck.20011017213225.debug 
> amcheck: debug 1 pid 27006 ruid 43382 euid 0 start time Wed Oct 17 21:32:25 2001
> amcheck: dgram_bind: socket bound to 0.0.0.0.711
> changer: got exit: 0 str: MT=/usr/bin/mt
> changer_query: changer return was 
> could not get changer info: badly formed result from changer: "MT=/usr/bin/mt"
> amcheck-server: pid 27007 finish time Wed Oct 17 21:32:25 2001
> amcheck: pid 27006 finish time Wed Oct 17 21:32:25 2001
> 
> --donnie

Reply via email to