rc.setup 4.18 KB
Newer Older
1
2
3
#!/bin/sh
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
5
6
7
8
# All rights reserved.
#
. /etc/emulab/paths.sh

9
10
11
12
13
# Check for kernel rename
if [ -x $BINDIR/rc.kname ]; then
        $BINDIR/rc.kname
fi

14
15
16
17
18
19
20
21
22
23
24
25
26
echo "Informing the testbed that we've rebooted ..."
$BINDIR/tmcc state TBSETUP

if [ -x $BINDIR/tbshutdown ]; then
        echo "Starting up shutdown notification daemon ..."
        $BINDIR/tbshutdown
fi

if [ -x $BINDIR/rc.ipod ]; then
	echo "Setting up IPOD ... "
        $BINDIR/rc.ipod
fi

Leigh B. Stoller's avatar
Leigh B. Stoller committed
27
28
29
echo "Doing Testbed bootsetup configuration ..."
$BINDIR/bootsetup

30
31
32
33
34
35
36
37
38
39
if [ -x $BOOTDIR/rc.tunnel ]; then
        echo "Setting up Testbed tunnels ..."
        $BOOTDIR/rc.tunnel
fi

if [ -x $BOOTDIR/rc.ifc ]; then
        echo "Setting up Testbed interfaces ..."
        $BOOTDIR/rc.ifc
fi

40
41
42
43
#
# The check for rc.delay below is to support this being installed
# on older 4.7 images!
#
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
if [ -x $BINDIR/delaysetup ]; then
	echo "Checking Testbed delay configuration ..."
	$BINDIR/delaysetup

	if [ -x $BOOTDIR/rc.linkdelay ]; then
	        echo "Setting up Testbed link delays ..."
	        $BOOTDIR/rc.linkdelay
	fi

	# Note: no routing on delay nodes
	if [ -x $BOOTDIR/rc.delay ]; then
	        echo "Setting up Testbed delays ..."
	        $BOOTDIR/rc.delay
	elif [ -x $BOOTDIR/rc.route ]; then
	        echo "Setting up Testbed interface routing ..."
		$BOOTDIR/rc.route enable
	fi
61
62
63
elif [ -x $BOOTDIR/rc.linkdelay ]; then
	echo "Setting up Testbed link delays ..."
	$BOOTDIR/rc.linkdelay
64
65
66
67
68
69
70
elif [ -x $BOOTDIR/rc.delay ]; then
        # Note: no routing on delay nodes.
        echo "Setting up Testbed delay configuration ..."
        $BOOTDIR/rc.delay
elif [ -x $BOOTDIR/rc.route ]; then
        echo "Setting up Testbed interface routing ..."
	$BOOTDIR/rc.route enable
71
72
fi

73
74
75
76
77
if [ -x $BOOTDIR/rc.syncserver  ]; then
        echo "Starting Sync Server ..."
	$BOOTDIR/rc.syncserver
fi

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
if [ -x $BOOTDIR/rc.rpm  ]; then
        echo "Installing RPMs ..."
	$BOOTDIR/rc.rpm
fi

if [ -x $BOOTDIR/rc.tarballs  ]; then
        echo "Installing Tarballs ..."
	$BOOTDIR/rc.tarballs
fi

if [ -x $BINDIR/rc.healthd ]; then
	echo "Starting node health monitoring ..."
	$BINDIR/rc.healthd start
fi

93
if [ -x $BINDIR/rc.slothd ]; then
94
	echo "Starting usage detector ..."
95
        killall slothd > /dev/null 2>&1
96
        rm -f /var/run/slothd.pid
97
	$BINDIR/rc.slothd start
98
99
100
101
102
103
104
105
106
fi

if [ -x $BINDIR/watchdog  ]; then
        echo "Starting update watchdog ..."
	$BINDIR/watchdog
fi

/bin/rm -f /var/at/jobs/S*
/bin/rm -f /var/spool/at/S*
107
if [ -s $BOOTDIR/startupcmd ]; then
108
109
110
111
        echo "Scheduling startup command to run in a little bit ..."
	echo "$BINDIR/runstartup" | at -q S 'now + 2 minutes'
fi

112
113
114
#
# Start the elvin proxy.
#
115
if [ -x $BINDIR/evproxy -a -r $BOOTDIR/nickname ]; then
116
	echo "Starting elvin proxy daemon ..."
117
118
119
120
121
122
123
	# XXX find our boss IP, evproxy should be fixed to not hardwire it
	if [ -r $BOOTDIR/bossip ]; then
		BOSSIP=`cat $BOOTDIR/bossip`
	else
		BOSSIP=`$BINDIR/tmcc bossinfo | awk '{print $2}'`
	fi
	$BINDIR/evproxy -s $BOSSIP -e `cat $BOOTDIR/nickname | awk -F. '{print $3"/"$2}'`
124
125
126
127
128
fi

#
# Start the linktest daemon. It talks to the elvind on boss also.
#
129
if [ ! -x $BOOTDIR/rc.delay -a -x $BINDIR/rc.linktest ]; then
130
	echo "Starting linktest daemon ..."
131
        $BINDIR/rc.linktest start
132
133
fi

134
135
136
137
138
139
140
141
142
if [ -x $BINDIR/rc.agents  ]; then
	$BINDIR/rc.agents
fi

if [ -x $BOOTDIR/rc.traffic  ]; then
        echo "Starting traffic generators ..."
	$BOOTDIR/rc.traffic
fi

143
144
145
if [ -x $BOOTDIR/rc.simulator  ]; then
        echo "Starting Network Simulation ..."
	$BOOTDIR/rc.simulator
146
147
148
149
150
151
	# The simulator will send the ISUP once it is
	# up and running
	echo "Will Inform the testbed that we're up and running after simulator initialization ..."
else
	echo "Informing the testbed that we're up and running ..."
	$BINDIR/tmcc state ISUP
152
153
fi

Leigh B. Stoller's avatar
Leigh B. Stoller committed
154
155
156
157
158
159
160
161
# Now boot vnodes. Doing it after ISUP is better; os_setup will consider
# the node ready, and move onto waiting for vnodes to boot. 
if [ -x $BINDIR/bootvnodes  ]; then
        echo "Booting up vnodes ..."
	# Foreground mode.
	$BINDIR/bootvnodes -f
fi

162
163
164
165
166
167
168
# Subnodes. Will everntually merge with vnodes above.
if [ -x $BINDIR/bootsubnodes  ]; then
        echo "Booting up subnodes ..."
	# Foreground mode.
	$BINDIR/bootsubnodes -f
fi