Changeset cc0ffd2
- Timestamp:
- Feb 28, 2010 11:28:41 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 358e0b8
- Parents:
- f017447
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/federate.pl
rf017447 rcc0ffd2 7 7 use IO::Pipe; 8 8 use File::Copy; 9 10 use Net::hostent; 11 use Socket; 9 12 10 13 use gateway_lib; … … 24 27 my $smbuser; 25 28 my $smbproject; 29 my $exp; 30 my $proj; 26 31 chomp (my $uname = `uname`); 27 32 my $smbmount = "smbmount.$uname.pl"; … … 40 45 while (<$tmcc_p>) { 41 46 /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"; 43 49 last; 44 50 }; … … 68 74 my $config_hosts = new IO::File("$shared_config_dir/hosts") || 69 75 die "Can't open $shared_config_dir/hosts: $!\n"; 76 my $has_control = 0; 70 77 71 78 while (<$hosts>) { 72 79 /^127\.0\.0\.1/ && do { print $new_hosts $_; }; 80 /control\./ && $has_control++; 73 81 } 74 82 $hosts->close(); … … 77 85 } 78 86 $config_hosts->close(); 87 88 # If seer is enabled and no local control node in play, alias the gateway to be 89 # control 90 if ($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 } 79 97 $new_hosts->close(); 80 98 copy("/tmp/hosts", "/etc/hosts");
Note: See TracChangeset
for help on using the changeset viewer.