Show
Ignore:
Timestamp:
05/17/08 17:09:31 (4 years ago)
Author:
Ted Faber <faber@…>
Children:
387408bfc5a9f0a310f6797876b4c24213b862f4
Parents:
2396559e3a4242e7e6b7a769d4b129b47685634a
git-committer:
Ted Faber <faber@isi.edu> / 2008-05-18T00:09:31Z+0000
Message:

checkpoint includes some ucb and some FC6 code

Location:
fedkit
Files:
3 added
3 modified
1 moved

Legend:

Unmodified
Added
Removed
  • fedkit/fed_bootstrap

    r4abace9 rf3691ff  
    2222 
    2323# The copy 
    24 for f in federate.sh smbmount.pl; do  
     24for f in federate.sh smbmount*.pl *.patch; do  
    2525        cp $SCRIPTDIR/$f /tmp && chmod 755 /tmp/$f 
    2626done 
  • fedkit/federate.sh

    r4abace9 rf3691ff  
    2121# automount process. 
    2222RCACCT="rc.accounts" 
    23 SMBMOUNT="smbmount.pl" 
     23SMBMOUNT="smbmount.`uname`.pl" 
     24 
     25# Find the right version of pkill.  For killing. 
     26if [ -x "/usr/bin/pkill" ] ; then  
     27        PKILL="/usr/bin/pkill" 
     28else 
     29        if [ -x "/bin/pkill" ] ; then  
     30                PKILL="/bin/pkill" 
     31        else 
     32                PKILL="echo" 
     33        fi 
     34fi 
     35 
     36if [ -x "/usr/bin/perl" ]; then 
     37    PERL="/usr/bin/perl" 
     38else 
     39    if [ -x "/usr/local/bin/perl" ]; then 
     40        PERL="/usr/local/bin/perl" 
     41    else 
     42        # Wing it... 
     43        PERL="perl" 
     44    fi 
     45fi 
    2446 
    2547# Find somewhere safe to stop 
     
    3456 
    3557# Find this experiment's stashed scripts.  (Perl for advanced parsing) 
    36 SCRIPTDIR=`$EMUDIR/tmcc -b status | perl -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "/proj/$1/exp/$2/tmp\n";'` 
     58SCRIPTDIR=`$EMUDIR/tmcc -b status | $PERL -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "/proj/$1/exp/$2/tmp\n";'` 
    3759 
    3860# Die if Scripts are not where they should be.  NB, this is checked by the 
     
    5375# Get our gateway, share, and mount user from the configuration file. 
    5476# There's probably a way to get all three at once, but this works. 
    55 GATEWAY=`perl -ne '/ControlGateway:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
    56 SHARE=`perl -ne '/SMBShare:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
    57 SMBUSER=`perl -ne '/ProjectUser:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
     77GATEWAY=`$PERL -ne '/ControlGateway:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
     78SHARE=`$PERL -ne '/SMBShare:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
     79SMBUSER=`$PERL -ne '/ProjectUser:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
     80SMBPROJECT=`$PERL -ne '/ProjectName:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 
     81 
     82# XXX: 
     83# The standard emulab rc.accounts script won't replace existing user accounts 
     84# with our new ones, so we have to patch it to do so.  This is obviously pretty 
     85# fragile and needs to change.  To make matters worse, our FBSD62-SMB images 
     86# contain the patched rc.accounts, so this patching step will fail there. 
     87cd "$EMUDIR/rc" 
     88patch -f < /tmp/rc.accounts.patch 
     89cd /tmp 
    5890 
    5991# 
     
    80112 
    81113# 
    82 # Unmount stuff before messing with accounts 
     114# Unmount stuff before messing with accounts  
     115# Linux doesn't believe in -A so run umount without it if the first fails 
    83116# 
    84 umount -A -f -t nfs,smbfs 
    85117 
     118umount -A -f -t nfs,smbfs,cifs  || umount -a -f -t nfs,smbfs,cifs 
    86119 
    87120# 
    88121# Setup new accounts 
    89122# 
     123 
     124# Clear the cache, just in case: 
     125rm -f /var/emulab/boot/tmcc/accounts 
     126 
    90127$RCDIR/rc.accounts reconfig 
    91128 
    92129# 
    93 # Call the smbmount perl script, this invokes the automounter to mount teh 
     130# Call the smbmount perl script, this invokes the automounter to mount the 
    94131# needed smb filesystems. 
    95132# 
    96133echo "Mounting via SMB." 
    97 "/tmp/$SMBMOUNT" $SHARE $GATEWAY $SMBUSER  
     134$PERL "/tmp/$SMBMOUNT" $SHARE $GATEWAY $SMBUSER $SMBPROJECT 
    98135 
    99136echo "Restoring old bossnode" 
     
    108145# partial topology -e.g. failed or partial bridging - that might have confused 
    109146# the router should be gone. 
    110 /bin/pkill ospf 
    111 /bin/pkill gated 
     147$PKILL ospf 
     148$PKILL gated 
     149# XXX Danger, hack ahead.  Apparently our FC6-SMB image and emulab disagree 
     150# about where gated lives.  This will alias it. 
     151if [ ! -x /usr/sbin/gated ] ; then  
     152        if [ -x /sbin/gated ] ; then 
     153                ln /sbin/gated /usr/sbin/gated 
     154        fi 
     155fi 
    112156/usr/local/etc/emulab/rc/rc.route boot 
    113157 
  • fedkit/smbmount.FreeBSD.pl

    r30184e4 rf3691ff  
    1 #!/usr/local/bin/perl 
     1#!/usr/bin/perl 
    22 
    33############################################################################# 
    44# smbmounts.pl: Setup Automounter to mount via SMB for federated experiments 
    5 # $Id: smbmount.pl,v 1.4 2007-09-27 20:53:16 jhickey Exp $ 
     5# $Id: smbmount.FreeBSD.pl,v 1.1 2008-05-18 00:09:31 faber Exp $ 
    66# 
    77 
  • fedkit/splitter.pl

    r2396559e rf3691ff  
    99use File::Copy; 
    1010 
    11 my @scripts = ("fed_bootstrap", "federate.sh", "smbmount.pl",  
    12     "make_hosts", "fed-tun.pl", "fed_evrepeater" ); 
     11my @scripts = ("fed_bootstrap", "federate.sh", "smbmount.FreeBSD.pl",  
     12    "smbmount.Linux.pl", "make_hosts", "fed-tun.pl", "fed_evrepeater", 
     13    "rc.accounts.patch"); 
    1314my $local_script_dir = "."; 
    1415my($pid, $gid);                 # Process and group IDs for calling parse.tcl 
     
    492493$project_user = $opts{'smbuser'} ||     # User to mount project dirs as 
    493494    die "Must give an SMB user\n"; 
    494 $auth_proj = $opts{'P'} || die "Must give an authentication project (-P)\n"; 
     495$auth_proj = $opts{'P'}; 
    495496 
    496497# tcl program to split experiments (changed during devel) 
     
    574575        # If this testbed has not had its access parameters read from fedd, try 
    575576        # to read them, if we have a way to talk to fedd 
    576         unless ($tbparams->{$tb}->{'access'} && $fedd_client) {  
     577        unless ($tbparams->{$tb}->{'access'} || !$fedd_client) {  
    577578            my $access_pipe = new IO::Pipe ||  
    578579                die "Can't open pipe to fedd:$!\n"; 
     580            my $proj = $auth_proj ? " -p $auth_proj " : ""; 
    579581 
    580582            print("Checking access to $tb using " . $tbparams->{$tb}->{'uri'} 
     
    583585            my $cmd = "$fedd_client -t " .  
    584586                $tbparams->{$tb}->{'uri'} .  " -T $ENV{HOME}/cacert.pem ". 
    585                 "-l $tb -p $auth_proj | /usr/bin/tee fedd.$tb "; 
     587                "-l $tb $proj | /usr/bin/tee fedd.$tb "; 
    586588            print "$cmd\n" if $verbose; 
    587589