Michael Fung wrote:
> Dear Josh,
>
>
> Thanks for releasing the vchanger script and HOWTO!
>
> However, I found a problem around line 94:
>
>   # Create nextmag file to hold max magazine index used
>   if [ ! -f "${statedir}/nextmag" ]; then
>      echo 0 >"${statedir}/nextmag"
>
> It created the nextmag file with content "0". That makes the following 
> section allways gives error "nextmag has invalid value".
>
>   # Check nextmag value
>   nextmag=`cat "${statedir}/nextmag"`
>   if [ $? -ne 0 -o "${nextmag}" == "" -o $nextmag -lt 1 -o $nextmag 
> -gt 99 ]; then
>      echo "${statedir}/nextmag has invalid value"
>      return 1
>   fi

Yes, thank you. That is a bug. It should be:

  # Check nextmag value
  nextmag=`cat "${statedir}/nextmag"`
  if [ $? -ne 0 -o "${nextmag}" == "" -o $nextmag -lt 0 -o $nextmag -gt 
99 ]; then
     echo "${statedir}/nextmag has invalid value"
     return 1
  fi

I will post an updated version to this list.

>
> Also, before and after changed the script to not gives error, I still 
> got the error after issue the "label barcodes" command:
>    Connecting to Storage daemon USBChanger1 at 192.168.1.1:9103 ...
>    3306 Issuing autochanger "slots" command.
>    Device "usb-changer-1" has 0 slots.
>    No slots in changer to scan.
>
> I run the script by hand to test output:
> [EMAIL PROTECTED] bacula]# ./vchanger /etc/bacula/vchanger1.conf slots
> 7
>
> It reports 7 slots correctly. Could you give me some hints?  I am 
> using Bacula 1.38.11 on RHEL 4 clone.
>
Did you run the test by hand as root? If so, then it is likely a 
permissions problem. Normally, vchanger will run as the user and group 
that bacula-sd runs as (usually bacula.disk if installed from RPMs). 
Make sure /etc/bacula/vchanger1.conf can be read by the bacula-sd user 
and/or group. Likewise, make sure the bacula-sd user and/or group  has 
read/write permissions for the vchanger state directory (probably at 
/var/bacula/vchanger1). Also, the bacula-sd user/group must have 
read/write permissions for the mounted USB disk partition.
>
> Many thanks!
> Michael
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to