Changeset 4702322 for fedkit


Ignore:
Timestamp:
Sep 25, 2009 1:51:15 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
Children:
6c1981f
Parents:
0fa1729
Message:

Add config to make file.

Remove remoteconfigfile from fed-tun.pl as well as removing the need to call
with a config file name.

Do not attempt to set up routes on nodes without a router parameter.

Location:
fedkit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fedkit/Makefile

    r0fa1729 r4702322  
    11BINARIES=federate.sh smbmount.FreeBSD.pl smbmount.Linux.pl \
    2          make_hosts fed-tun.pl fed_evrepeater rc.fedaccounts
     2         make_hosts fed-tun.pl fed_evrepeater rc.fedaccounts \
     3         config_from_tunnelip.pl
    34
    45fedkit.tgz:     ${BINARIES} ${PATCHES}
  • fedkit/fed-tun.pl

    r0fa1729 r4702322  
    7676my $remote_script_dir;          # location of the other sides fed-tun.pl
    7777my $event_repeater;             # The pathname of the event repeater
    78 my $remote_config_file;         # Config file for the other side
    7978
    8079if ($#ARGV != 0 && !getopts('df:rn', \%opts)) {
     
    135134    $remote_script_dir = $opts{'remotescriptdir'} || ".";
    136135    $event_repeater = $opts{'eventrepeater'};
    137     $remote_config_file = $opts{'remoteconfigfile'};
    138     $remote_config_file = "-f $remote_config_file" if $remote_config_file;
     136    my $listen_on = $opts{'sshlisten'};
    139137
    140138    if (defined($opts{'fsname'})) {
    141         push(@ssh_port_fwds,"-R :$SMBFS_PORT:$opts{'fsname'}:$SMBFS_PORT");
     139        push(@ssh_port_fwds,"-R $listen_on:$SMBFS_PORT:$opts{'fsname'}:$SMBFS_PORT");
    142140    }
    143141
    144142    if (defined($opts{'bossname'})) {
    145         push(@ssh_port_fwds, "-R :$TMCD_PORT:$opts{'bossname'}:$TMCD_PORT");
     143        push(@ssh_port_fwds, "-R $listen_on:$TMCD_PORT:$opts{'bossname'}:$TMCD_PORT");
    146144    }
    147145
    148146    if (defined($opts{'eventservername'})) {
    149147        push(@ssh_port_fwds,"-R ".
    150             ":$remote_pubsub_port:$opts{'eventservername'}:$PUBSUB_PORT");
     148            "$listen_on:$remote_pubsub_port:$opts{'eventservername'}:$PUBSUB_PORT");
    151149    }
    152150    if (defined($opts{'remoteeventservername'})) {
     
    157155    # Forward connections to seer from remote TBs to control in this TB
    158156    if (defined($opts{'seercontrol'})) {
    159         push(@ssh_port_fwds,"-R :$SEER_PORT:$opts{seercontrol}:$SEER_PORT");
     157        push(@ssh_port_fwds,"-R $listen_on:$SEER_PORT:$opts{seercontrol}:$SEER_PORT");
    160158    }
    161159
     
    241239    if ($type eq "control") {
    242240        foreach my $fwd (@ssh_port_fwds) {
    243             system("$SSH -N $fwd -Nno \"StrictHostKeyChecking no\" ".
     241            system("$SSH -N $fwd -o \"StrictHostKeyChecking no\" ".
    244242                "$opts{'peer'} &"); #or die "Failed to run ssh";
    245243        }
     
    279277            "-o \"StrictHostKeyChecking no\" " .
    280278            "$opts{'peer'}  \"$remote_script_dir/fed-tun.pl " .
    281             "$remote_config_file -r $addr $count\" & |";
     279            "-r $addr $count\" & |";
    282280
    283281        print "$cmd\n" if $debug;
     
    415413    close(TMCD);
    416414
    417     die "Unable to determine tunnel node configuration information"
    418         if (!defined($tunnel_router) || !$tunnel_router);
    419 
    420415    print "tunnel options:  ip=$tunnel_ip mask=$tunnel_mask mac=$tunnel_mac router=$tunnel_router\n" if ($debug);
    421416
     
    433428    warn "configuration of tunnel interface failed" if ($?);
    434429
    435     # Sometimes the insertion of DNS names lags a bit.  Retry this
    436     # configuration a few times to let DNS catch up.  Might want to really
    437     # check the DNS name before we try this...
    438     my $config_succeeded = 0;
    439     my $tries = 0;
    440     my $max_retries = 300;
    441 
    442     do {
    443         system("route add $opts{'peer'} $tunnel_router");
    444         if ( $? ) {
    445             warn "configuration routes via tunnel interface failed";
    446             $tries++;
    447             sleep(10);
    448         }
    449         else { $config_succeeded = 1; }
    450     } until ( $config_succeeded || $tries > $max_retries );
     430    if ($tunnel_router) {
     431
     432        # Sometimes the insertion of DNS names lags a bit.  Retry this
     433        # configuration a few times to let DNS catch up.  Might want to really
     434        # check the DNS name before we try this...
     435        my $config_succeeded = 0;
     436        my $tries = 0;
     437        my $max_retries = 300;
     438
     439        do {
     440            system("route add $opts{'peer'} $tunnel_router");
     441            if ( $? ) {
     442                warn "configuration routes via tunnel interface failed";
     443                $tries++;
     444                sleep(10);
     445            }
     446            else { $config_succeeded = 1; }
     447        } until ( $config_succeeded || $tries > $max_retries );
     448    }
    451449
    452450    print "setup_tunnel_cfg done\n" if ($debug);
Note: See TracChangeset for help on using the changeset viewer.