Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 33

Thread: FreeBSD 6.4-RELEASE amtape DailySet2 eject

  1. #21
    Join Date
    Apr 2008
    Location
    Goshen, KY
    Posts
    38

    Unhappy

    Okay, I must be doing something wrong ... the results are the same.

    I copied a new version of compat.pm to Amanda/Changer.

    Was there something else I needed to do?

  2. #22
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    688

    Default

    Well, there's one way to tell -- introduce a syntax error into the compat.pm that you're overwriting. If it doesn't cause Amanda's behavior to change, then you're overwriting the wrong file.

  3. #23
    Join Date
    Apr 2008
    Location
    Goshen, KY
    Posts
    38

    Smile

    I've done that.

    I inserted an Amanda::Debug::debug("processing EJECT") line in compat.pm to verify correct execution.

    I've created a test server with the same library hardware (an Exabyte EZ17).

    now I don't have to worry about leaving anything in a "not quite ready for prime time" state.

    Can you briefly explain the interfaces between Changer.pm, compat.pm, chg-glue and chg-zd-mtx?

    Also, "amtape <config> clean" seems to insist on loading the "current" tape, even when no tape was loaded previously. Is this desired/expected/required behavior?

  4. #24
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    688

    Default

    The changer operational pathway is as follows:

    An Amanda application (amtape, taper, amfetchdump, etc.) invokes C-level changer functions. The C source (server-src/changer.{c,h}) spawns chg-glue and communicates Changer-API-1.0 commands to it using a simple line-based protocol. chg-glue interfaces those commands to the 2.0 perl API (Amanda::Changer). In this case, the changer in use is an old-style shell script (chg-zd-mtx), so chg-glue uses the Amanda::Changer::compat class, which spawns a new chg-zd-mtx process for each operation. Yeah, it's pretty convoluted, but contains *two* compatibility bridges which will soon be eliminated.

    Did you see any results from your "processing EJECT" line?

    As for the clean operation subsequently loading the "current" slot -- yeah, I'm not sure why I did that:
    Code:
    149 sub do_clean {
    150     my $do_clean = sub {
    151         $chg->clean(
    152             finished_cb => sub {
    153                 my ($error) = @_;
    154                 if ($error) {
    155                     print "EXITSTATUS 1\n";
    156                     print "<error> $error\n";
    157                     Amanda::MainLoop::call_later(\&getcmd);
    158                 } else {
    159***                  do_slot("current");
    160                 }
    161             },
    162             drive => '',
    163         );
    164     };
    165     release_and_then([], $do_clean);
    166 }

  5. #25
    Join Date
    Apr 2008
    Location
    Goshen, KY
    Posts
    38

    Smile

    The "processing EJECT" line verifies that I did, in fact, install compat.pm properly.

    Unfortunately, as I state last night, the resulting debug logs look identical to the earlier ones (with updated timestamp, of course).

    So, I am still confused.

    What's next?

  6. #26
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    688

    Default

    Oh! I bet you didn't see the changes to chg-glue. You can download it here:
    [url]http://github.com/djmitche/amanda/raw/changerfixes/changer-src/chg-glue.pl[/url]
    and replace your existing chg-glue. The only trick is to look at the 'use lib' line near the beginning of the original, and copy/paste it into the new version.

    I don't know how familiar you are with 'git', but if you're interested, I can help you fork the repository ([url]http://wiki.zmanda.com/index.php/Fork_Amanda_on_Github[/url]) and set up a test-build ([url]http://wiki.zmanda.com/index.php/Testing[/url]) environment for you. You need a bit more equipment ([url]http://wiki.zmanda.com/index.php/Minimum_Versions[/url]) to build Amanda from the version control rather than a tarball, but it's not too much.

  7. #27
    Join Date
    Apr 2008
    Location
    Goshen, KY
    Posts
    38

    Smile

    You're right.

    I didn't see chg-glue.pl.

    I copied chg-glue.pl to chg-glue.

    command: amtape DailySet2 eject

    result: "amtape: slot <none> is ejected."

    the actual slot was 4.

    The tape was ejected.

    debug logs:

    1234310356.708838: amtape: pid 22029 ruid 90 euid 90 version 2.6.1: start at Tue Feb 10 18:59:16 2009
    1234310356.711559: amtape: pid 22029 ruid 90 euid 90 version 2.6.1: rename at Tue Feb 10 18:59:16 2009
    1234310356.712635: amtape: changer: >> -eject
    1234310382.440514: amtape: changer: << EXITSTATUS 0
    1234310382.440603: amtape: changer: << <none> volume ejected
    1234310382.440710: amtape: pid 22029 finish time Tue Feb 10 18:59:42 2009

    1234310356.837977: chg-glue: pid 22030 ruid 90 euid 90 version 2.6.1: start at Tue Feb 10 18:59:16 2009
    1234310356.903244: chg-glue: pid 22030 ruid 90 euid 90 version 2.6.1: rename at Tue Feb 10 18:59:16 2009
    1234310356.938596: chg-glue: got command '-eject'
    1234310356.938683: chg-glue: processing EJECT
    1234310356.938716: chg-glue: running simple op 'eject'
    1234310382.440310: chg-glue: simple op 'eject' ok

    1234310357.097171: chg_zd_mtx: pid 22041 ruid 90 euid 90 version 2.6.1: start at Tue Feb 10 18:59:17 2009
    18:59:17 Using config file /usr/local/etc/amanda/DailySet2/chg-zd-mtx.conf
    18:59:17 Arg info:
    $# = 1
    $0 = "/usr/local/libexec/amanda/chg-zd-mtx"
    $1 = "-eject"
    18:59:17 Running: /usr/local/sbin/mtx status
    18:59:18 Exit code: 0
    Stdout:
    Storage Changer /dev/changer:1 Drives, 7 Slots ( 0 Import/Export )
    Data Transfer Element 0:Full (Storage Element 4 Loaded)
    Storage Element 1:Full
    Storage Element 2:Full
    Storage Element 3:Full
    Storage Element 4:Empty
    Storage Element 5:Full
    Storage Element 6:Full
    Storage Element 7:Full
    18:59:18 Config info:
    firstslot = "1"
    lastslot = "7"
    cleanslot = "7"
    cleancycle = "60"
    offline_before_unload = "1"
    unloadpause = "0"
    autoclean = "0"
    autocleancount = "99"
    havereader = "0"
    driveslot = "0"
    poll_drive_ready = "3"
    initial_poll_delay = "0"
    max_drive_wait = "120"
    18:59:18 EJECT -> ejecting tape from /dev/nsa0
    18:59:18 STATUS -> currently loaded slot = 4
    -> currently loaded barcode = ""
    18:59:18 EJECT -> moving tape from drive 0 to storage slot 4
    18:59:18 Running: try_eject_device /dev/nsa0
    18:59:32 Exit code: 0
    18:59:32 Running: /usr/local/sbin/mtx unload 4 0
    18:59:40 Exit code: 0
    Stdout:
    Unloading drive 0 into Storage Element 4...done
    18:59:40 -> status 0, result "Unloading drive 0 into Storage Element 4...done"
    18:59:40 Exit (0) -> 4 tape:/dev/nsa0
    1234310380.434458: unknown: pid 22255 ruid 90 euid 90 version 2.6.1: at Tue Feb 10 18:59:40 2009
    1234310380.434544: unknown: pid 22255 finish time Tue Feb 10 18:59:40 2009

  8. #28
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    688

    Default

    Great!

    As far as which slot was actually ejected, that's kind of a messy notion. The *drive* was ejected, but what the changer did with that volume is unspecified -- it may still be halfway-inserted in the drive; it may be back in slot 4; it may be in the robot arm .. so the new changer API prefers not to make any representations.

  9. #29
    Join Date
    Apr 2008
    Location
    Goshen, KY
    Posts
    38

    Exclamation

    Will these patches (chg-glue and compat.pm) be included in a near future snapshot?

  10. #30
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    688

    Default

    They have already been committed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •