Amanda-Users

Re: problems with chg-zd-mtx and using 2 drives

2007-10-16 14:34:42
Subject: Re: problems with chg-zd-mtx and using 2 drives
From: Jon LaBadie <jon AT jgcomp DOT com>
To: amanda-users AT amanda DOT org
Date: Tue, 16 Oct 2007 14:23:57 -0400
On Tue, Oct 16, 2007 at 11:22:34AM -0500, Krahn, Anderson wrote:
> Mtx is installed in /usr/local/sbin which is in the path of the Amanda
> and root user.
> amanda@prdapp16
> [/home/amanda]#which mtx
> /usr/local/sbin/mtx
> 
> amanda@prdapp16
> [/home/amanda]#logout
> 
> root@prdapp16
> [~]#which mtx
> /usr/local/sbin/mtx
> 
> -----Original Message-----
> From: owner-amanda-users AT amanda DOT org
> [mailto:owner-amanda-users AT amanda DOT org] On Behalf Of Jon LaBadie
> Sent: Tuesday, October 16, 2007 11:09 AM
> To: amanda-users AT amanda DOT org
> Subject: Re: problems with chg-zd-mtx and using 2 drives
> 
> On Tue, Oct 16, 2007 at 10:53:09AM -0500, Krahn, Anderson wrote:
> > Here are some errors i get with chg-zd-mtx:
> > 
> > chg-zd-mtx: debug 1 pid 9380 ruid 30063 euid 30063: start at Mon Oct
> > 
> > 15 14:34:48 2007
> > 
> > 14:34:48 Using config file /etc/amanda/Full/changer.conf
> > 
> > 14:34:48 Arg info:
> > 
> >          $# = 1
> > 
> >          $0 = "/opt/amanda/client/libexec/chg-zd-mtx"
> > 
> >          $1 = "-info"
> > 
> > 14:34:48 Running: mtxRunning: status
> > 
> > 14:34:48 Exit code: 127
> > 
> >          Stderr:
> > 
> > /opt/amanda/client/libexec/chg-zd-mtx: line 389: mtx: command not
> found
>  
> ^^^^^^^^^^^^^^^^^^^^^^
> 
> I don't know why the PATH variable in effect when this script
> is running does not include the directory for the mtx binary,
> but that does appear to be the case.
> 
> 

That may be true, but I'd still check if PATH is suitable
IN THE SCRIPT.  There is a PATH= statement in chg-zd-mtx
that resets what you see from the command line.

The message syntax "prog: line: cmd: command not found"
is pretty specific and only (to my knowledge) used for the
stated purpose.  It is not like "no such file or directory"
that may deal with permissions or typos or ...

Also, line 389 is a line from which mtx would be executed.
It is the only place where mtx would be executed and it
is only called to from three other places in the script.
When called, the command name is passed as $MTX.  From the
message this appears to be "mtx" but I think in amanda.h
or config.h you could specify a full pathname and recompile.

Here are some things you could try to test my idea.
First, replace chg-zd-mtx with a copy.

Edit the copy and insert before line 389 a
"which mtx > file_of_your_choosing 2>&1".

You could also add an "echo $PATH > some_file".

Finally, you could try to specify where mtx is located.
Early in the script set MTX to the full path to mtx,
i.e. "MTX=/usr/local/sbin/mtx".  This will override amanda's
builtin definition.


-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)