X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=changer-src%2Fchg-chio.pl.in;h=56bb35875f2b7a4d15fe0ad822235780abbbe331;hb=d3b2175e084f88c8736ad7073eacbf4670147aec;hp=79c7a393b05e237f464854cdc92b97b58077ad5a;hpb=34197d9f46a5f4e944378cbb65fca32ee0eec7b9;p=debian%2Famanda diff --git a/changer-src/chg-chio.pl.in b/changer-src/chg-chio.pl.in index 79c7a39..56bb358 100644 --- a/changer-src/chg-chio.pl.in +++ b/changer-src/chg-chio.pl.in @@ -286,6 +286,16 @@ sub Load { print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n"; exit(2); } + + # wait for tape to load + $count = 1800; + while ( $count > 0 && + system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) { + print LOG &do_time(), ": waiting for tape to load\n"; + sleep 30; + $count -= 30; + } + print LOG &do_time(), ": leave: Load\n"; } @@ -307,8 +317,8 @@ sub Unload { # firmware rev but for now it's safest to just explicitly eject # the tape before moving the cartridge. # - if ( system ("@MT@ @MT_FILE_FLAG@ $tapeDevice offline") ) { - print "$progname: Warning, failed to eject the tape with '@MT@ @MT_FILE_FLAG@ $tapeDevice offline'\n"; + if ( system ("$MT $MTF $tapeDevice offline") ) { + print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n"; # NB: not fatal; let chio try it's thing } @@ -375,7 +385,7 @@ if (-x "$sbindir/ammt$SUF") { print " mt program not found\n"; exit(1); } -print LOG &do_time(), "MT -> $MT $MTF\n"; +print LOG &do_time(), ": MT -> $MT $MTF\n"; system ("$MT $MTF $tapeDevice rewind") unless $currentTape == 0;