At Thu, 10 Mar 2022 12:46:43 -0500 Nathan Stratton Treadway <natha...@ontko.com> 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. > > (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".... The timeout never times out. The amtape process goes into Sleep state and the Java program just hangs. > > > Nathan > > > > > ---------------------------------------------------------------------------- > Nathan Stratton Treadway - natha...@ontko.com - 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 > > > -- Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364 Deepwoods Software -- Custom Software Services http://www.deepsoft.com/ -- Linux Administration Services hel...@deepsoft.com -- Webhosting Services