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 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=''";

(I am not particularly certain that interactivity is your specific
problem, but it seemed a plausible explaination and one that that was
fairly easy to test out...)


>         if (!p.waitFor(60L, java.util.concurrent.TimeUnit.SECONDS)) {
>             System.err.printf("*** FlushOldVaults.amtape(): process timeout\n");
>             String kill[] = new String[2];
>             kill[0] = "/bin/kill";
>             Long j = new Long(p.pid());
>             kill[1] = j.toString();
>             Process killproc = Runtime.getRuntime().exec(kill);
>             killproc.waitFor();

Note that in order to use the strace debugging, you'll probably need to
disable this timeout+kill logic -- otherwise the amtape process won't
hang out long enough for you to figure out what it's trying to do when
when it's "stuck"....


						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.