jbrsubscribe wrote: > Josh Fisher wrote: > > >> 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 >> > I am also trying to run this script and I get the sane error as reported by > Michael..even after I make the suggested changes. In addition to that I > don't quite understand this Device Resource statement - especially where it > says ArchiveDecice = /var/bacula/vchanger1/drive0. > > #--- drive 0 of the usb-changer-1 autochanger > Device { > Name = usb-changer-1-drive-0 > DriveIndex = 0 > Autochanger = yes; > DeviceType = File > MediaType = File > ArchiveDevice = /var/bacula/vchanger1/drive0 > RemovableMedia = no; > RandomAccess = yes; > } > > Why is that being done? That directory does not actually exist. Perhaps I am > missing something. If so I would appreciate any help from anyone who has > managed to get this to work >
ArchiveDevice specifies the path to a symlink that will point to the regular file containing the currently "loaded" volume. The symlink is dynamically created by the script when a volume is "loaded" and deleted when it is "unloaded". When bacula-sd opens the symlink, it will see that it is a regular file, not a directory, and read/write to the real file that the symlink points to. The problem is likely permissions. For an autochanger with config file at /etc/bacula/vchanger1, state information directory at /var/bacula/vchanger1, and the mountpoint for the magazine partitions at /mnt/vchanger1/magazine, then if bacula-sd is running as user bacula: 1. User bacula must have read/write access to the /var/bacula/vchanger1 directory and everything in it 2. User bacula must have read/write access to the entire filesystem mounted at /mnt/vchanger1/magazine 3. User bacula must have read access to /etc/bacula/vchanger1.conf If the script was tested by running it from the command line as root prior to it being invoked from bacula-sd, then some of those files/directories will be owned by root. This will cause permissions problems when it is later invoked by bacula-sd as user bacula. Using the example above, you can test for a permission problem as root by: # su bacula /etc/bacula/vchanger /etc/bacula/vchanger1.conf list 1 /var/bacula/vchanger1/drive0 0 ..and you can fix permission problems as root by: # chown -R bacula.disk /var/bacula/vchanger1 # chown bacula.disk /etc/bacula/vchanger1.conf # chown -R bacula.disk /mnt/vchanger1/magazine I am working on a revision of the howto and script that will address this issue and will post it to this list when finished. > Jerome > > > > > ------------------------------------------------------------------------- > 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