Changeset 4abace9 for fedkit/federate.sh
- Timestamp:
- Feb 29, 2008 9:45:35 AM (16 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- f64fa81
- Parents:
- 906c763
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/federate.sh
r906c763 r4abace9 1 1 #!/bin/sh 2 2 3 # Take the user and the user's startcmd as arguments 3 # Set up a federated environment on a client. Unmount all local file systems, 4 # erase all local accounts and then bring in accounts and file systems from the 5 # master testbed. Once all that's done, restore client communication to the 6 # local bossnode and execute any startup command passed in as arguments to this 7 # script. 4 8 9 10 # The file containing the DNS name of the current boss 5 11 BOSSNODE="/usr/local/etc/emulab/bossnode" 6 # GATEWAY="detertunnel"7 12 13 # Ports that the master gateway will forward 8 14 PORTS="139 7777" 15 # network cat command (to listen for the gateway) 9 16 NC="/usr/bin/nc" 17 # Emulab rc scripts directory 10 18 RCDIR="/usr/local/etc/emulab/rc" 11 19 20 # Emulab rc script to reset accounts and federation srcipt to start the smb 21 # automount process. 12 22 RCACCT="rc.accounts" 13 23 SMBMOUNT="smbmount.pl" … … 26 36 SCRIPTDIR=`$EMUDIR/tmcc -b status | perl -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "/proj/$1/exp/$2/tmp\n";'` 27 37 28 # Die if things are weird 38 # Die if Scripts are not where they should be. NB, this is checked by the 39 # bootstrapper, too, so a failure here is unlikely. 29 40 if [ -z "$SCRIPTDIR" ] ; then 30 41 echo "Can't find federation scripts. Tmcc status says:" … … 33 44 fi 34 45 35 # Move the SMB mounting script out of NFS so we can call it after the umount36 cp "$SCRIPTDIR/$SMBMOUNT" /tmp37 38 46 # Copy the global hostnames file into /etc/hosts so this node can address 39 # others in the experiment on other testbeds. 47 # others in the experiment on other testbeds. The extra steps preserves teh 48 # localhost entry that's aliased to this host's name. 40 49 grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts 41 50 cat "$SCRIPTDIR/hosts" >> /tmp/hosts … … 67 76 68 77 echo "Configuring TMCC." 69 70 $EMUDIR/sethostname71 72 78 echo $GATEWAY > $BOSSNODE 73 79 … … 85 91 86 92 # 87 # Copy and exec the smbmount perl script 93 # Call the smbmount perl script, this invokes the automounter to mount teh 94 # needed smb filesystems. 88 95 # 89 90 96 echo "Mounting via SMB." 91 92 97 "/tmp/$SMBMOUNT" $SHARE $GATEWAY $SMBUSER 93 98 99 echo "Restoring old bossnode" 100 # remove bossnode override 101 /bin/rm -f $BOSSNODE 102 # Also clear any cached data that might interfere with rourte construction. 103 /bin/rm -f /var/emulab/boot/tmcc/ifconfig 104 105 # I remain unclear why ospfd seems screwed up after the resetting of accounts 106 # and mounts. This seems to fix it, but it's not very satisfying. At this 107 # point the federated topology is complete, so any problems with routing in a 108 # partial topology -e.g. failed or partial bridging - that might have confused 109 # the router should be gone. 110 /bin/pkill ospf 111 /bin/pkill gated 112 /usr/local/etc/emulab/rc/rc.route boot 113 114 # Execute any command passed in as a startcmd. This basically daisy chains the 115 # startcmd. 94 116 if [ ! -z "$1" ]; then 95 117 su -l "$1" -c "$2"
Note: See TracChangeset
for help on using the changeset viewer.