IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34942


Ignore:
Timestamp:
Jan 16, 2013, 3:40:33 PM (14 years ago)
Author:
Serge CHASTEL
Message:

Volumes which can be nfs-mounted but whose host are down are now managed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20121218/Nebulous-Server/bin/nebdiskd

    r34928 r34942  
    362362    $df_data =~ s/\s+/:/g;
    363363    $log->debug("Received from ssh = [$df_data]");
     364    my %df_info = ();
     365    $df_info{"blocks"} = 0;
     366    $df_info{"used"} = 0;
    364367    unless ($df_data) {
     368        # We cannot connect to the host for some reason However, the
     369        # partition can be mounted on some other hosts (in the case of
     370        # an original host failure or upgrade for instance) Let's look
     371        # for an entry in /etc/autofs/auto.data starting with
     372        # <hostname>.[012] If it's in there, return (blocks => 1, used
     373        # => 1). The partition is mounted but not available for
     374        # replication (since blocks-used = 0 and used/blocks=1=100%).
     375        my $partition_name = $mountpoint;
     376        $partition_name =~ s/\/export\///;
     377        $log->debug("Looking for $partition_name in /etc/autofs/auto.data");
     378        open(AUTODATA, "</etc/autofs/auto.data") or die("Can't open /etc/autofs/auto.data");
     379        foreach my $line (<AUTODATA>) {
     380            if ($line =~ /^$partition_name/) {
     381                $log->debug("$partition_name found in /etc/autofs/auto.data");
     382                close(AUTODATA);
     383                $df_info{"blocks"} = 1;
     384                $df_info{"used"} = 1;
     385                return \%df_info;
     386            }
     387        }
     388        $log->debug("$partition_name NOT found in /etc/autofs/auto.data");
     389        close(AUTODATA);
    365390        return undef;
    366391    }
    367392    my @data = split(/:/, $df_data);
    368     my %df_info = ();
    369393    $df_info{"blocks"} = $data[1];
    370394    $df_info{"used"} = $data[2];
Note: See TracChangeset for help on using the changeset viewer.