3.testbed.sh.in 7.16 KB
Newer Older
1
2
3
4
#!/bin/sh
#
# Utah Network Testbed local startup
#
Mike Hibler's avatar
Mike Hibler committed
5
6

# PROVIDE: testbed
7
# REQUIRE: mysql pubsub mfrisbeed
Mike Hibler's avatar
Mike Hibler committed
8
9
10
# BEFORE: apache22
# KEYWORD: shutdown

11
case "$1" in
12
	start|faststart|quietstart|onestart|forcestart)
13
14
15
16
17
18
19
20
21
22
23
24
25
		#
		# See if the testbed is "shutdown"; The variable has three values.
	        #  0  - Testbed is enabled.
	        #  1  - Testbed is disabled.
		# -1  - Testbed is coming back online, so start up daemons.
		#
	        if [ -x @prefix@/sbin/setsitevar ]; then
		    disabled=`@prefix@/sbin/setsitevar -c general/testbed_shutdown`
		    if [ $disabled -gt 0 ]; then
			echo -n " testbed disabled"
			exit 0
		    fi
		fi
26
		if [ -x @prefix@/sbin/dbboot ]; then
27
28
		        # Delay a moment so that mysqld has started!
		        sleep 2
29
30
31
			echo -n " dbboot"
			@prefix@/sbin/dbboot
		fi
32

33
34
35
36
		if [ -x @prefix@/sbin/bootinfo.restart  ]; then
			echo -n " bootinfo"
			@prefix@/sbin/bootinfo.restart
		fi
37

38
39
40
41
		if [ -x @prefix@/sbin/tmcd.restart  ]; then
			echo -n " tmcd"
			@prefix@/sbin/tmcd.restart
		fi
42

43
44
45
46
		if [ -x @prefix@/sbin/capserver  ]; then
			echo -n " capd"
			@prefix@/sbin/capserver
		fi
Leigh B. Stoller's avatar
Leigh B. Stoller committed
47

48
49
50
51
		if [ -x @prefix@/sbin/lastlog_daemon  ]; then
			echo -n " lastlogd"
			@prefix@/sbin/lastlog_daemon
		fi
52

53
54
55
56
		if [ -x @prefix@/sbin/sdcollectd  ]; then
			echo -n " sdcollectd"
			@prefix@/sbin/sdcollectd
		fi
57

58
59
60
61
		if [ -x @prefix@/sbin/stated  ]; then
			echo -n " stated"
			@prefix@/sbin/stated
		fi
Mike Hibler's avatar
Mike Hibler committed
62

63
64
65
		if [ -e @prefix@/etc/inetd.conf  ]; then
			echo -n " testbed-inetd"
			inetd -a @BOSSNODE@ -p /var/run/testbed-inetd.pid @prefix@/etc/inetd.conf
66
		fi
Mike Hibler's avatar
Mike Hibler committed
67

68
		if [ -x @prefix@/sbin/sslxmlrpc_server.py ]; then
69
			echo -n " sslxmlrpc_server"
70
			@prefix@/sbin/sslxmlrpc_server.py 2>/dev/null
71
72
		fi

73
		# mfrisbeed started with its own script
74

75
76
77
78
79
		if [ -x @prefix@/sbin/reload_daemon  ]; then
			echo -n " reloadd"
			@prefix@/sbin/reload_daemon
		fi

Timothy Stack's avatar
   
Timothy Stack committed
80
81
82
83
84
		if [ -x @prefix@/sbin/checkup_daemon  ]; then
			echo -n " checkupd"
			@prefix@/sbin/checkup_daemon
		fi

85
86
87
88
		if [ -x @prefix@/sbin/mysqld_watchdog  ]; then
			echo -n " mysqld_watchdog"
			@prefix@/sbin/mysqld_watchdog
		fi
89

Mike Hibler's avatar
Mike Hibler committed
90
91
92
93
94
		if [ -x @prefix@/sbin/lease_daemon  ]; then
			echo -n " lease_daemon"
			@prefix@/sbin/lease_daemon
		fi

Leigh B. Stoller's avatar
Leigh B. Stoller committed
95
		if [ -x @prefix@/sbin/protogeni/expire_daemon ]; then
96
97
98
99
			echo -n " expire_daemon"
			@prefix@/sbin/protogeni/expire_daemon
		fi

100
101
102
103
104
		if [ -x @prefix@/sbin/protogeni/sa_daemon ]; then
			echo -n " sa_daemon"
			@prefix@/sbin/protogeni/sa_daemon
		fi

105
106
107
108
109
		if [ -x @prefix@/sbin/protogeni/ch_daemon ]; then
			echo -n " ch_daemon"
			@prefix@/sbin/protogeni/ch_daemon
		fi

110
111
112
113
114
		if [ -x @prefix@/sbin/protogeni/igevent_daemon ]; then
			echo -n " igevent_daemon"
			@prefix@/sbin/protogeni/igevent_daemon
		fi

115
116
117
118
119
		if [ -x @prefix@/sbin/checknodes_daemon  ]; then
			echo -n " checknodes_daemon"
			@prefix@/sbin/checknodes_daemon
		fi

120
121
122
123
124
		if [ -x @prefix@/sbin/portal_daemon  ]; then
			echo -n " portal_daemon"
			@prefix@/sbin/portal_daemon
		fi

125
126
127
128
129
		if [ -x @prefix@/sbin/poolmonitor ]; then
			echo -n " poolmonitor"
			@prefix@/sbin/poolmonitor
		fi

130
131
132
133
134
		if [ -x @prefix@/sbin/tcppd ]; then
		        echo -n " tcppd"
			@prefix@/sbin/tcppd &
		fi

135
136
137
138
139
		if [ -x @prefix@/sbin/event_watchdog ]; then
		        echo -n " event_watchdog"
			@prefix@/sbin/event_watchdog
		fi

140
141
142
143
144
		if [ -x @prefix@/sbin/apt_daemon ]; then
			echo -n " apt_daemon"
			@prefix@/sbin/apt_daemon
		fi

145
146
147
148
149
		if [ -x @prefix@/sbin/aptevent_daemon ]; then
			echo -n " aptevent_daemon"
			@prefix@/sbin/aptevent_daemon
		fi

Leigh B Stoller's avatar
Leigh B Stoller committed
150
151
152
153
154
		if [ -x @prefix@/sbin/apt_checkup ]; then
			echo -n " apt_checkup"
			@prefix@/sbin/apt_checkup
		fi

155
156
		if [ -n "@ATTENUATOR@" -a -x @prefix@/sbin/attend ]; then
			echo -n " attend"
157
			@prefix@/sbin/attend
158
159
		fi

160
		if /usr/local/bin/mysql monitoring </dev/null >/dev/null 2>&1; then
Gary Wong's avatar
Gary Wong committed
161
			if [ -x @prefix@/sbin/protogeni/mondbd ]; then
162
163
164
			       echo -n " mondbd"
			       @prefix@/sbin/protogeni/mondbd
			fi
Gary Wong's avatar
Gary Wong committed
165
			if [ -x @prefix@/sbin/protogeni/shared-node-listener ]; then
166
167
			       echo -n " shared-node-listener"
			       @prefix@/sbin/protogeni/shared-node-listener &
168
                               echo $! > /var/run/shared-node-listener.pid
169
170
171
			fi
		fi
		
172
173
174
175
176
		#
		# Could trigger experiment creation, so make sure everything
		# else is setup first; i.e., run this last!
		#
		if [ -x @prefix@/sbin/batch_daemon  ]; then
177
178
179
180
181
182
183
184
			echo -n " batchd wrapper "
			if [ -x @prefix@/sbin/daemon_wrapper ]; then
				@prefix@/sbin/daemon_wrapper \
				  -i 30 -l @prefix@/log/batchlog \
				  @prefix@/sbin/batch_daemon -d
			else
				@prefix@/sbin/batch_daemon
			fi
185
186
		fi
		;;
187
	stop|faststop|quietstop|onestop|forcestop)
188
189
		if [ -r /var/run/bootinfo.pid ]; then
			kill `cat /var/run/bootinfo.pid`
190
191
192
193
		fi
		if [ -r /var/run/tmcd.pid ]; then
			kill `cat /var/run/tmcd.pid`
		fi
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
		if [ -r /var/run/capserver.pid ]; then
			kill `cat /var/run/capserver.pid`
		fi
		if [ -r /var/run/lastlog_daemon.pid ]; then
			kill `cat /var/run/lastlog_daemon.pid`
		fi
		if [ -r /var/run/sdcollectd.pid ]; then
			kill `cat /var/run/sdcollectd.pid`
		fi
		if [ -r /var/run/stated.pid ]; then
			kill `cat /var/run/stated.pid`
		fi
		if [ -r /var/run/testbed-inetd.pid ]; then
			kill `cat /var/run/testbed-inetd.pid`
		fi
		if [ -r /var/run/sslxmlrpc_server.pid ]; then
			kill `cat /var/run/sslxmlrpc_server.pid`
		fi
		if [ -r /var/run/reload_daemon.pid ]; then
			kill `cat /var/run/reload_daemon.pid`
		fi
		if [ -r /var/run/checkup_daemon.pid ]; then
			kill `cat /var/run/checkup_daemon.pid`
		fi
		if [ -r /var/run/pool_daemon.pid ]; then
			kill `cat /var/run/pool_daemon.pid`
		fi
		if [ -r /var/run/mysqld_watchdog.pid ]; then
			kill `cat /var/run/mysqld_watchdog.pid`
		fi
Mike Hibler's avatar
Mike Hibler committed
224
225
226
		if [ -r /var/run/lease_daemon.pid ]; then
			kill `cat /var/run/lease_daemon.pid`
		fi
227
228
229
230
231
232
		if [ -r /var/run/expire_daemon.pid ]; then
			kill `cat /var/run/expire_daemon.pid`
		fi
		if [ -r /var/run/sa_daemon.pid ]; then
			kill `cat /var/run/sa_daemon.pid`
		fi
233
234
235
		if [ -r /var/run/ch_daemon.pid ]; then
			kill `cat /var/run/ch_daemon.pid`
		fi
236
237
238
		if [ -r /var/run/igevent_daemon.pid ]; then
			kill `cat /var/run/igevent_daemon.pid`
		fi
239
240
241
		if [ -r /var/run/checknodes.pid ]; then
			kill `cat /var/run/checknodes.pid`
		fi
Leigh B Stoller's avatar
Leigh B Stoller committed
242
243
244
		if [ -r /var/run/checknodes_daemon.pid ]; then
			kill `cat /var/run/checknodes_daemon.pid`
		fi
245
246
247
		if [ -r /var/run/batch_daemon_wrapper.pid ]; then
			kill `cat /var/run/batch_daemon_wrapper.pid`
		fi
248
249
250
		if [ -r /var/run/portal_daemon.pid ]; then
			kill `cat /var/run/portal_daemon.pid`
		fi
251
252
253
		if [ -r /var/run/poolmonitor.pid ]; then
			kill `cat /var/run/poolmonitor.pid`
		fi
254
255
256
		if [ -r /var/run/tcppd.pid ]; then
			kill `cat /var/run/tcppd.pid`
		fi
257
258
259
		if [ -r /var/run/event_watchdog.pid ]; then
			kill `cat /var/run/event_watchdog.pid`
		fi
260
261
262
		if [ -r /var/run/apt_daemon.pid ]; then
			kill `cat /var/run/apt_daemon.pid`
		fi
263
264
265
		if [ -r /var/run/aptevent_daemon.pid ]; then
			kill `cat /var/run/aptevent_daemon.pid`
		fi
Leigh B Stoller's avatar
Leigh B Stoller committed
266
267
268
		if [ -r /var/run/apt_checkup.pid ]; then
			kill `cat /var/run/apt_checkup.pid`
		fi
269
270
271
		if [ -r /var/run/attend.pid ]; then
			kill `cat /var/run/attend.pid`
		fi
272
273
274
275
276
277
		if [ -r /var/run/mondbd.pid ]; then
			kill `cat /var/run/mondbd.pid`			
		fi
		if [ -r /var/run/shared-node-listener.pid ]; then
			kill `cat /var/run/shared-node-listener.pid`
		fi
278
279
280
281
282
283
284
285
286

		;;
	*)
		echo ""
		echo "Usage: `basename $0` { start | stop }"
		echo ""
		exit 64
		;;
esac
287
exit 0