Changeset cc0ffd2 for fedkit


Ignore:
Timestamp:
Feb 28, 2010 11:28:41 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
358e0b8
Parents:
f017447
Message:

Missed a newline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/federate.pl

    rf017447 rcc0ffd2  
    77use IO::Pipe;
    88use File::Copy;
     9
     10use Net::hostent;
     11use Socket;
    912
    1013use gateway_lib;
     
    2427my $smbuser;
    2528my $smbproject;
     29my $exp;
     30my $proj;
    2631chomp (my $uname = `uname`);
    2732my $smbmount = "smbmount.$uname.pl";
     
    4045while (<$tmcc_p>) {
    4146    /ALLOCATED=([^\/]+)\/(\S+)/ && do {
    42         $shared_config_dir = "/proj/$1/exp/$2/tmp";
     47        ($proj, $exp) = ($1, $2);
     48        $shared_config_dir = "/proj/$proj/exp/$exp/tmp";
    4349        last;
    4450    };
     
    6874my $config_hosts = new IO::File("$shared_config_dir/hosts") ||
    6975    die "Can't open $shared_config_dir/hosts: $!\n";
     76my $has_control = 0;
    7077
    7178while (<$hosts>) {
    7279    /^127\.0\.0\.1/ && do { print $new_hosts $_; };
     80    /control\./ && $has_control++;
    7381}
    7482$hosts->close();
     
    7785}
    7886$config_hosts->close();
     87
     88# If seer is enabled and no local control node in play, alias the gateway to be
     89# control
     90if ($services{'seer'} && !$has_control ) {
     91    if ( my $hent = gethostbyname($gateway) ) {
     92        my $gwip = inet_ntoa($hent->addr_list->[0]);
     93
     94        print $new_hosts "\n$gwip\tcontrol.$exp.$proj\n";
     95    }
     96}
    7997$new_hosts->close();
    8098copy("/tmp/hosts", "/etc/hosts");
Note: See TracChangeset for help on using the changeset viewer.