rc.setup 3.11 KB
Newer Older
1
2
3
#!/bin/sh
#
# EMULAB-COPYRIGHT
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# All rights reserved.
#
. /etc/emulab/paths.sh

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
22
23
24
echo "Doing Testbed bootsetup configuration ..."
$BINDIR/bootsetup

25
26
27
28
29
30
31
32
33
34
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

35
36
37
38
#
# The check for rc.delay below is to support this being installed
# on older 4.7 images!
#
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
56
57
58
elif [ -x $BOOTDIR/rc.linkdelay ]; then
	echo "Setting up Testbed link delays ..."
	$BOOTDIR/rc.linkdelay
59
60
61
62
63
64
65
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
fi

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

83
if [ -x $BINDIR/rc.slothd ]; then
84
	echo "Starting usage detector ..."
85
        killall slothd > /dev/null 2>&1
86
        rm -f /var/run/slothd.pid
87
	$BINDIR/rc.slothd start
88
89
90
91
92
93
94
95
96
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*
97
if [ -s $BOOTDIR/startupcmd ]; then
98
99
100
101
        echo "Scheduling startup command to run in a little bit ..."
	echo "$BINDIR/runstartup" | at -q S 'now + 2 minutes'
fi

102
103
104
105
106
107
108
109
#
# Start the elvin proxy.
#
if [ -x $BINDIR/evproxy ]; then
	echo "Starting elvin proxy daemon ..."
	$BINDIR/evproxy -e `cat $BOOTDIR/nickname | awk -F. '{print $3"/"$2}'`
fi

110
111
112
113
114
115
116
117
118
119
120
if [ -x $BINDIR/rc.agents  ]; then
	$BINDIR/rc.agents
fi

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

echo "Informing the testbed that we're up and running ..."
$BINDIR/tmcc state ISUP
Leigh B. Stoller's avatar
Leigh B. Stoller committed
121
122
123
124
125
126
127
128
129

# 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