Comment 5 for bug 1077105

Revision history for this message
Klaus Müller (k-mueller) wrote :

Here a set of workarounds from a PERL programmer:

Version: Ubuntu LTS 12.04 or Kubuntu LTS 12.04 (tested on Kubuntu)
Amada package version 1:3.3.0 (Ubuntun package reference)

First the issue related on http://old.nabble.com/amrecover---can%27t-talk-to-tape-server%3A-service-amidxtaped%3A-td31861008.html is not related to a particular PERL version. It is just poor programming. This may happen... especially if the programmer is in a hurry.

Next: we are professionals so we are able to fix. Accordingly: DO IT!

===> Detecting the bug:

If you are affected the following statement issued in /usr/lib/amanda/perl/Amanda will return mor than just one line with Scribe.pm:

find . -type f -exec egrep -l "param +qw" {} \;

===> Workaround A:

The bug on is only concerning only a few files located in /usr/lib/amanda/perl/Amanda. The list of the files to fix in order to have a proper work around are:

/usr/lib/amanda/perl/Amanda/Recovery/Clerk.pm
/usr/lib/amanda/perl/Amanda/Recovery/Planner.pm
/usr/lib/amanda/perl/Amanda/Taper/Scribe.pm

For each of these files secure the lines hodling [param qw..] . become param ( qw... ) <= two parenthesis to add that is it. Example: Clerk.pm - line 231

Initial: for my $rq_param qw(dump xfer_src_cb) {...
Corrected: for my $rq_param ( qw(dump xfer_src_cb) ) {

Once this is done Amanda's perl code will match the PERL specifications for loops: (from perldoc.perl.org) :

LABEL for (EXPR; EXPR; EXPR) BLOCK ### Notice the parenthesis after the keyword for
LABEL for VAR (LIST) BLOCK ### Our case and we just fix the parenthesis around LIST
LABEL for VAR (LIST) BLOCK continue BLOCK

===> Workaround B:

Download the PERL modules above from the Amanda code repository and copy them in the locations of workaround A. They will work unless you use a very old PERL version.

For both workaround: add the services definition for amindexd and amidxtaped and you will be able to restore.

Have a nice restore.