Changeset 34943 for trunk/Nebulous-Server/bin/nebdiskd
- Timestamp:
- Jan 16, 2013, 3:41:12 PM (14 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
bin/nebdiskd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server
- Property svn:mergeinfo changed
/tags/ipp-20121218/Nebulous-Server merged: 34942
- Property svn:mergeinfo changed
-
trunk/Nebulous-Server/bin/nebdiskd
r34929 r34943 362 362 $df_data =~ s/\s+/:/g; 363 363 $log->debug("Received from ssh = [$df_data]"); 364 my %df_info = (); 365 $df_info{"blocks"} = 0; 366 $df_info{"used"} = 0; 364 367 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); 365 390 return undef; 366 391 } 367 392 my @data = split(/:/, $df_data); 368 my %df_info = ();369 393 $df_info{"blocks"} = $data[1]; 370 394 $df_info{"used"} = $data[2];
Note:
See TracChangeset
for help on using the changeset viewer.
