IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 30, 2010, 9:31:50 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/Nebulous-Server/bin/nebdiskd

    r27103 r28794  
    5353# set the process name for easy pgrep-ability
    5454$0 = 'nebdiskd';
    55 my $rcfile = "$ENV{HOME}/.nebdiskrc";
     55#my $rcfile = "$ENV{HOME}/.nebdiskrc";
     56my $rcfile = $ENV{NEBDISKDRC};
     57unless (defined($rcfile)) {
     58    $rcfile = '/etc/nebdiskd.rc';
     59}
    5660$rcfile = File::Spec->canonpath($rcfile);
    5761
     
    7175my %host_removed = ();
    7276my $failure_limit = 5;
    73 
    74 
    7577
    7678#my $mounts = $c->get_mounts;
     
    143145$SIG{HUP}  = sub { $c = read_rcfile($rcfile) };
    144146
     147my $date = localtime();
     148$log->warn("BEGIN: $date with RCFILE: $rcfile");
    145149
    146150while (1) {
     
    187191
    188192    eval {
    189         my $r_query = $dbh->prepare_cached("REPLACE INTO mountedvol SELECT vol_id,name,host,path,allocate,available,xattr,mountpoint, ?, ? FROM volume WHERE mountpoint = ?");
     193        my $r_query = $dbh->prepare_cached("REPLACE INTO mountedvol SELECT vol_id,name,host,path,allocate,available,xattr,mountpoint, ?, ?,note FROM volume WHERE mountpoint = ?");
    190194#       my $d_query = $dbh->prepare_cached("UPDATE mountedvol SET allocate = ?, available = ? WHERE mountpoint = ?");
    191195        my $d_query = $dbh->prepare_cached("DELETE FROM mountedvol WHERE mountpoint = ?");
     
    224228                }
    225229            };
     230
     231            # fetch stats on the mounted device.  this has to be done AFTER
     232            # we determine if it's a valid mountpoint incase
     233            # is_mountpoint() invokes the automounter
     234            my $dev_info = df($mountpoint, 1024);
     235            unless (defined $dev_info) {
     236                $valid_mountpoint = 0;
     237            }
     238
    226239            if (!$valid_mountpoint) {
    227240                # try is_mountpoint() again if $retry > 1
     
    254267            # we determine if it's a valid mountpoint incase
    255268            # is_mountpoint() invokes the automounter
    256             my $dev_info = df($mountpoint, 1024);
     269            $dev_info = df($mountpoint, 1024);
    257270            unless (defined $dev_info) {
    258271                $log->error("can't find device info for $mountpoint");
Note: See TracChangeset for help on using the changeset viewer.