Re: Problem with amtape "hanging" when forked from Java

Nathan Stratton Treadway <[email protected]>
Newsgroups gmane.comp.archivers.amanda.user
Message-ID <[email protected]>
On Thu, Mar 10, 2022 at 13:02:24 -0500, Robert Heller wrote:
> At Thu, 10 Mar 2022 12:46:43 -0500 Nathan Stratton Treadway <[email protected]> wrote:
> 
> > 
> > On Thu, Mar 10, 2022 at 09:55:30 -0500, Robert Heller wrote:
> > > Here is the Java fragment:
> > > 
> > > public class FlushOldVaults extends BackupVault {
> > >     private static final String AMTAPE = "/usr/sbin/amtape";
> > >     private static final String AMTAPEOPT1 = "-otpchanger=vault_changer";
> > >     private static final String AMTAPEOPT2 = "-ointeractivity=";
> > 
> > You would probably be able to confirm this by looking in the amanda
> > log/debug files for the amtape process (i.e.
> > /var/log/amanda/server/<CONFIG>/amtape.*.debug on Ubuntu) , but I'm pretty
> > sure that you do actually need the empty argument in order to disable
> > the interactivity, something like
> >      private static final String AMTAPEOPT2 = "-ointeractivity=''";
> 
> It does not like the empty argument,  amtape throws a error status and the 
> Java subprocess returns a failure status.  It is "happy" with what I have, 
> except it hangs on the broken tape.

Okay, sounds like the argument parsing is different in the Java .exec()
context than on a shell command line.  The important question is whether
or not the interactivity is actually disabled....  perhaps the amtape .debug
file gives some confirmation?


> The timeout never times out.  The amtape process goes into Sleep state and the 
> Java program just hangs.

In that case hopefully strace -p/lsof -p on the amtape process (or any
other Amanda processes that amtape spawns) can give some hint as to what
it's waiting for....

							Nathan





----------------------------------------------------------------------------
Nathan Stratton Treadway  -  [email protected]  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.