/[smecontribs]/rpms/smeserver-arkeia/contribs7/smeserver-arkeia-1.0-rotateupdate.patch
ViewVC logotype

Contents of /rpms/smeserver-arkeia/contribs7/smeserver-arkeia-1.0-rotateupdate.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Tue Nov 25 17:10:59 2008 UTC (15 years, 11 months ago) by slords
Branch: MAIN
CVS Tags: smeserver-arkeia-1_0-22_el4_sme, smeserver-arkeia-1_0-21_el4_sme, smeserver-arkeia-1_0-26_el4_sme, smeserver-arkeia-1_0-29_el4_sme, smeserver-arkeia-1_0-20_el4_sme, smeserver-arkeia-1_0-27_el4_sme, smeserver-arkeia-1_0-19_el4_sme, HEAD
Changes since 1.2: +1 -1 lines
Again

1 --- smeserver-arkeia-1.0/root/etc/e-smith/events/actions/rotate-tape.rotateupdate 2008-11-25 09:46:02.000000000 -0700
2 +++ smeserver-arkeia-1.0/root/etc/e-smith/events/actions/rotate-tape 2008-11-25 09:45:32.000000000 -0700
3 @@ -16,10 +16,19 @@
4 my $confdb = esmith::ConfigDB->open;
5 my $arkeia = $confdb->get('arkeia') or die "No arkeia db entry found\n";
6 my $rotate = $arkeia->prop('Rotate') || 'no';
7 +my $drivenum = $arkeia->prop('DriveNum') || 0;
8 +my $offset = $arkeia->prop('Offset') || 0;
9 my $changer = $arkeia->prop('Changer') || '/dev/changer';
10 +my $host = $arkeia->prop('Host') || 'localhost';
11
12 -exit 0 unless $rotate eq 'yes';
13 -exit 0 unless -c $changer;
14 +my $mtxcmd = "mtx -f $changer";
15 +if ($rotate eq 'remote') {
16 + $mtxcmd = "ssh $host $mtxcmd";
17 +} elsif ($rotate ne 'yes') {
18 + exit 0 unless -c $changer;
19 +} else {
20 + exit 0
21 +}
22
23 my $daily = $arkeia->prop("Daily") || 0;
24 my $weekly = $arkeia->prop("Weekly") || 0;
25 @@ -52,6 +61,12 @@
26 }
27 }
28 exit 0 unless $slot;
29 +$slot += $offset;
30
31 -system("/usr/sbin/mtx -f $changer unload &> /dev/null");
32 -system("/usr/sbin/mtx -f $changer load $slot") && die("A problem occurred execing mtx\n");
33 +my @status = qx($mtxcmd status);
34 +my $loaded = (grep { /Data Transfer Element $drivenum:Full/ } @status)[0];
35 +if ( $loaded && $loaded =~ m{ Element (\d+):Full .* Element (\d+) } ) {
36 + exit 0 if $2 == $slot;
37 + system("$mtxcmd unload $2 $1");
38 +}
39 +system("$mtxcmd load $slot $drivenum") && die("A problem occurred execing mtx\n");

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed