This for the archives, to save some poor SOB like myself days and days of
misery.
I was never able to get chg-scsi up and working PROPERLY under FreeBSD
4.3-STABLE. Even when I followed the advice of the amanda-users list and
CVS'd the latest sources, the resulting chg-scsi (it did build at least!)
would not work PROPERLY. It worked under root, but not under operator. An
amcheck would always result in:
bash-2.05# su -m operator -c 'amcheck -s love'
Amanda Tape Server Host Check
-----------------------------
Holding disk /disk2: 11843263 KB disk space available, using 11833023 KB
changer: got exit: 2 str: chg-scsi: open: 0:3:1: Permission denied
amcheck-server: could not get changer info: open: 0:3:1: Permission denied
could not get changer info: open: 0:3:1: Permission denied
amcheck-server: pid 83843 finish time Mon Jun 4 03:06:05 2001
I tried everything possible in terms of granting permissions, etc. I even
'chown operator:operator /dev/ch0'. But to no avail.
I got fed up and nuked all my downloaded distributions, and cleanly rebuilt
2.4.2p2 from the FreeBSD ports collection. I then began playing around
again with the glue script 'chg-chio'. It was rumored to have worked for
somebody at someplace at sometime. The command "chio status" worked, even
under operator's uid, but the command "amcheck -s love" (which ran
/usr/local/libexec/amanda/chg-chio) didn't. It would complain:
chg-chio: No drive or picker ? (1/0)
After studying the source code for /usr/local/libexec/amanda/chg-chio, I
found this section of code:
if ( $max_drive == 0 or $max_picker == 0 ) {
print "$progname: No drive or picker ? ($max_drive/$max_picker)\n";
exit(2);
}
I then recalled earlier the output of the command "chio params":
/dev/ch0: 6 slots, 1 drive, 0 picker
/dev/ch0: current picker: 0
I'm not sure why the logic behind chg-chio assumes that if there's no picker
something's wrong, but it does. I patched this piece of code by changing
the 'or' to an 'and' and now chg-chio works great on my box! Hurray! Three
weeks later and I'm about to perform my first backup! I'd have prefered
chg-scsi, but at this point I'll take anything that works!
-Sean Noonan