On Mon, May 28, 2012 at 08:14:02AM -0400, Jean-Louis Martineau wrote:
> Leon,
>
> Do the error are at the time you run amcheck?
Yes
> Try the attached patch.
Attached patch fixes the problem.
Thanks a lot,
Leon
> On 05/27/2012 09:33 PM, Leon Meßner wrote:
> > Hi,
> > i'm seeing the following errors in syslog using amanda-3.3.1:
> >
> > /var/log/messages:
> > May 28 02:52:07 silo Amzfs_sendrecv[61918]: Use of uninitialized value
> > $status in numeric ne (!=) at
> > /usr/local/lib/perl5/site_perl/5.14.2/Amanda/Script_App.pm line 103.
> > May 28 02:52:07 silo Amzfs_sendrecv[61918]: Use of uninitialized value
> > $status in numeric eq (==) at
> > /usr/local/lib/perl5/site_perl/5.14.2/Amanda/Script_App.pm line 107.
> >
> > The mentioned code reads:
> >
> > 100 sub print_to_server {
> > 101 my $self = shift;
> > 102 my($msg, $status) = @_;
> > 103 if ($status != 0) {
> > 104 $self->{error_status} = $status;
> > 105 }
> > 106 if ($self->{action} eq "check") {
> > 107 if ($status == $Amanda::Script_App::GOOD) {
> > 108 print STDOUT "OK $msg\n";
> >
> > There is a wrapper for this function which is often used in
> > Amanda/Application/Zfs.pm:
> >
> > 135 #$_[0] message
> > 136 #$_[1] status: GOOD or ERROR
> > 137 sub print_to_server_and_die {
> > 138 my $self = shift;
> > 139
> > 140 $self->print_to_server( @_ );
> > 141 if (!defined $self->{die}&&
> > $self->can("check_for_backup_failure")) {
> > 142 $self->{die} = 1;
> > 143 $self->check_for_backup_failure();
> > 144 }
> > 145 exit 1;
> > 146 }
> >
> > I couldn't figure where this is beeing called in the wrong way though.
> >
> > cheers,
> > Leon
>
> diff --git a/application-src/amzfs-sendrecv.pl
> b/application-src/amzfs-sendrecv.pl
> index 1bbbb9c..b0f95e2 100644
> --- a/application-src/amzfs-sendrecv.pl
> +++ b/application-src/amzfs-sendrecv.pl
> @@ -102,7 +102,8 @@ sub command_support {
> sub command_selfcheck {
> my $self = shift;
>
> - $self->print_to_server("disk " . quote_string($self->{disk}));
> + $self->print_to_server("disk " . quote_string($self->{disk}),
> + $Amanda::Script_App::GOOD);
>
> $self->print_to_server("amzfs-sendrecv version " .
> $Amanda::Constants::VERSION,
> $Amanda::Script_App::GOOD);