Changeset 9b3627e for fedkit/gateway_lib.pm
- Timestamp:
- Mar 9, 2010 1:08:05 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 4e9719b
- Parents:
- c2c153b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/gateway_lib.pm
rc2c153b r9b3627e 367 367 368 368 369 sub client_conf_filename { 370 # Find the configuration file in the usual places, if there is one in 371 # /usr/local/federation/etc, use it, otherwise look in the emulab standard 372 # filesystems which depends on what experiment and project we're in. 373 my $pid; 374 my $eid; 375 my $filename; 376 my $fed_dir = "/usr/local/federation/etc/"; 377 378 return "$fed_dir/client.conf" if -r "$fed_dir/client.conf"; 379 380 my $tmcd = new IO::Pipe() || die "Can't create pipe: $!\n"; 381 382 $tmcd->reader("$TMCC status"); 383 384 while (<$tmcd>) { 385 chomp; 386 /ALLOCATED=([^\/]+)\/(\S+)/ && do { 387 $pid = $1; 388 $eid = $2; 389 }; 390 } 391 $tmcd->close(); 392 $filename = "/proj/$pid/exp/$eid/tmp/client.conf" 393 if $pid and $eid; 394 395 return $filename; 396 } 397 369 398 sub wait_for_port { 370 399 my($addr, $port, $timeout, $sleep) = @_; … … 376 405 377 406 while (!$s) { 407 # We've seen some arp pollution, so be proactive about clearing the 408 # cache if we're waiting to get out. 409 system("arp -d -a"); 378 410 if (!($s = new IO::Socket(Domain => &AF_INET, PeerAddr => $addr, 379 411 PeerPort => $port))) {
Note: See TracChangeset
for help on using the changeset viewer.