Changeset f3691ff for fedkit/federate.sh


Ignore:
Timestamp:
May 17, 2008 5:09:31 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
387408b
Parents:
2396559e
Message:

checkpoint includes some ucb and some FC6 code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/federate.sh

    r2396559e 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
Note: See TracChangeset for help on using the changeset viewer.