source: fedkit/make_hosts @ fa19281

axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change on this file since fa19281 was 9d207bd, checked in by Ted Faber <faber@…>, 16 years ago

seer support

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/sh
2
3# find perl
4if [ -x "/usr/bin/perl" ]; then
5    PERL="/usr/bin/perl"
6else
7    if [ -x "/usr/local/bin/perl" ]; then
8        PERL="/usr/local/bin/perl"
9    else
10        # Wing it...
11        PERL="perl"
12    fi
13fi
14
15# Find this experiment's stashed scripts.  (Perl for advanced parsing)
16EMUDIR="/usr/local/etc/emulab/"
17PROJECT=`$EMUDIR/tmcc -b status | $PERL -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "$1\n";'`
18EXP=`$EMUDIR/tmcc -b status | $PERL -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "$2\n";'`
19SCRIPTDIR="/proj/$PROJECT/exp/$EXP/tmp"
20
21# Very simple script to copy the global hosts file over the local one
22# while preserving the localhost entry.  Run on DETER master clients
23
24grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts
25cat $1 >> /tmp/hosts
26cp /tmp/hosts /etc/hosts && rm /tmp/hosts
27
28# Find the right version of pkill.  For killing.
29if [ -x "/usr/bin/pkill" ] ; then 
30        PKILL="/usr/bin/pkill"
31else
32        if [ -x "/bin/pkill" ] ; then 
33                PKILL="/bin/pkill"
34        else
35                PKILL="echo"
36        fi
37fi
38
39# XXX: modified seer daemon to read a config file.  Not in the tarfile yet.  If
40# we see one, and there's a /usr/seer/backend/daemon.py, replace that one with
41# the local one.
42if [ -e /usr/seer/backend/daemon.py ] && [ -e $SCRIPTDIR/daemon.py ]; then
43        /bin/cp $SCRIPTDIR/daemon.py /usr/seer/backend/daemon.py
44fi
45
46if [ -e /usr/seer/backend/experiment-setup.py ] && [ -e $SCRIPTDIR/experiment-setup.py ]; then
47        /bin/cp $SCRIPTDIR/experiment-setup.py /usr/seer/backend/experiment-setup.py
48fi
49
50# Copy the seer.conf to the local /tmp if there is one
51
52if [ -e $SCRIPTDIR/seer.conf ]; then
53        /bin/cp $SCRIPTDIR/seer.conf /tmp
54fi
55
56
57# SEER feels pain and confusion if times are wrong.  This lays a big lick on
58# ntp sets the time directly and then restarts it.  XXX FreeBSD incantation is
59# untested.
60
61case `uname` in
62        "FreeBSD")
63                /etc/rc.d/ntpd stop
64                /usr/sbin/ntpdate boss
65                /etc/rc.d/ntpd start
66                ;;
67        "Linux")
68                /etc/rc.d/init.d/ntpd stop
69                /usr/sbin/ntpdate boss
70                /etc/rc.d/init.d/ntpd start
71                ;;
72esac
73# I remain unclear why ospfd seems screwed up after the resetting of accounts
74# and mounts.  This seems to fix it, but it's not very satisfying.  At this
75# point the federated topology is complete, so any problems with routing in a
76# partial topology -e.g. failed or partial bridging - that might have confused
77# the router should be gone.
78$PKILL ospf
79$PKILL gated
80
81# XXX Danger, hack ahead.  Apparently our FC6-SMB image and emulab disagree
82# about where gated lives.  This will alias it.
83if [ ! -x /usr/sbin/gated ] ; then 
84        if [ -x /sbin/gated ] ; then
85                ln /sbin/gated /usr/sbin/gated
86        fi
87fi
88/usr/local/etc/emulab/rc/rc.route
89
90
91# Execute any command passed in as a startcmd.  This basically daisy chains the
92# startcmd.  This needs to become a perl script to have uniform behavior here.
93echo "*$2* *$3*"
94if [ ! -z "$2" ]; then 
95        echo "calling *$2* *$3*"
96        case `uname` in
97                "FreeBSD")
98                        su -l "$2" -c "$3"
99                        ;;
100                "Linux")
101                        su "$2" --command="$3"
102                        ;;
103        esac
104fi
Note: See TracBrowser for help on using the repository browser.