Changeset d501c38 for fedkit


Ignore:
Timestamp:
Sep 18, 2007 2:57:54 PM (17 years ago)
Author:
Kevin Lahey <lahey@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
fe459d0
Parents:
c8c45ee
Message:

Tweaks to ensure that the tap interface is up before we configure the
tunnel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/fed-tun.pl

    rc8c45ee rd501c38  
    2121use IO::File;
    2222
     23my $IFCONFIG = "/sbin/ifconfig";
    2324my $TMCC = "/usr/local/etc/emulab/tmcc";
    2425my $SSH = "/usr/local/bin/ssh";
     
    140141    my @SSHCMD;
    141142
     143    # If we are just setting up a control net connection, just fire up
     144    # ssh with the null command, and hang loose.
     145
     146    if ($type eq "control") {
     147        system("$SSH $ssh_port_fwds -Nno \"StrictHostKeyChecking no\" $opts{'peer'} &"); #or die "Failed to run ssh";
     148
     149        exit;
     150    }
     151
    142152    open(IFFILE, "/var/emulab/boot/ifmap") || die "couldn't open ifmap\n";
    143153    while (<IFFILE>) {
     
    158168
    159169        my $check = <$SSHCMD[$count]>;  # Make sure something ran...
     170        print "Got line [$check] from remote side\n" if ($debug);
    160171
    161172        &setup_bridging($tun, $bridge, $iface, $addr);
     
    199210    my ($tun, $bridge, $iface, $addr) = @_;
    200211
    201     print "Got new $tun\n" if ($debug);
     212    print "Waiting to see if new iface $tun is up\n" if ($debug);
     213
     214    do {
     215        sleep 1;
     216        system("$IFCONFIG $tun");
     217    } until (!$?);
     218
    202219    print "setting up $bridge with $iface and nuking $addr\n" if ($debug);
    203220
Note: See TracChangeset for help on using the changeset viewer.