3.testbed.sh.in 8.37 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
		if [ -x @prefix@/sbin/apt_daemon ]; then
			echo -n " apt_daemon"
			@prefix@/sbin/apt_daemon
		fi
144
		
145 146 147 148 149
		if [ -x @prefix@/sbin/aptevent_daemon ]; then
			echo -n " aptevent_daemon"
			@prefix@/sbin/aptevent_daemon
		fi

150 151 152 153 154
		if [ -x @prefix@/sbin/apt_scheduler ]; then
			echo -n " apt_scheduler"
			@prefix@/sbin/apt_scheduler
		fi

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

Leigh B Stoller's avatar
Leigh B Stoller committed
160 161 162 163
		if [ -x @prefix@/sbin/portal_monitor ]; then
			echo -n " portal_monitor"
			@prefix@/sbin/portal_monitor
		fi
164 165 166 167 168

		if [ -x @prefix@/sbin/portal_resources ]; then
			echo -n " portal_resources"
			@prefix@/sbin/portal_resources
		fi
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
		#
		# Could trigger experiment creation, so make sure everything
		# else is setup first; i.e., run this last!
		#
		if [ @BOOTINFO_EVENTS@ -eq 0 -a -x @prefix@/sbin/reportboot_daemon  ]; then
			echo -n " reportboot daemon "
			if [ -x @prefix@/sbin/daemon_wrapper ]; then
			    @prefix@/sbin/daemon_wrapper -i 30 \
			          -l @prefix@/log/reportboot.log \
			          -p /var/run/reportboot_daemon.pid \
				  @prefix@/sbin/reportboot_daemon -f
			else
				@prefix@/sbin/reportboot_daemon
			fi
		fi
Leigh B Stoller's avatar
Leigh B Stoller committed
184

185 186
		if [ -n "@ATTENUATOR@" -a -x @prefix@/sbin/attend ]; then
			echo -n " attend"
187
			@prefix@/sbin/attend
188 189
		fi

190
		if /usr/local/bin/mysql monitoring </dev/null >/dev/null 2>&1; then
Gary Wong's avatar
Gary Wong committed
191
			if [ -x @prefix@/sbin/protogeni/mondbd ]; then
192 193 194
			       echo -n " mondbd"
			       @prefix@/sbin/protogeni/mondbd
			fi
Gary Wong's avatar
Gary Wong committed
195
			if [ -x @prefix@/sbin/protogeni/shared-node-listener ]; then
196
			       echo -n " shared-node-listener"
197
			       @prefix@/sbin/protogeni/shared-node-listener
198 199 200
			fi
		fi
		
201 202 203 204 205
		#
		# Could trigger experiment creation, so make sure everything
		# else is setup first; i.e., run this last!
		#
		if [ -x @prefix@/sbin/batch_daemon  ]; then
206 207 208 209 210 211 212 213
			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
214 215
		fi
		;;
216
	stop|faststop|quietstop|onestop|forcestop)
217 218
		if [ -r /var/run/bootinfo.pid ]; then
			kill `cat /var/run/bootinfo.pid`
219 220 221 222
		fi
		if [ -r /var/run/tmcd.pid ]; then
			kill `cat /var/run/tmcd.pid`
		fi
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
		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
253 254 255
		if [ -r /var/run/lease_daemon.pid ]; then
			kill `cat /var/run/lease_daemon.pid`
		fi
256 257 258 259 260 261
		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
262 263 264
		if [ -r /var/run/ch_daemon.pid ]; then
			kill `cat /var/run/ch_daemon.pid`
		fi
265 266 267
		if [ -r /var/run/igevent_daemon.pid ]; then
			kill `cat /var/run/igevent_daemon.pid`
		fi
268 269 270
		if [ -r /var/run/checknodes.pid ]; then
			kill `cat /var/run/checknodes.pid`
		fi
Leigh B Stoller's avatar
Leigh B Stoller committed
271 272 273
		if [ -r /var/run/checknodes_daemon.pid ]; then
			kill `cat /var/run/checknodes_daemon.pid`
		fi
274 275 276
		if [ -r /var/run/batch_daemon_wrapper.pid ]; then
			kill `cat /var/run/batch_daemon_wrapper.pid`
		fi
277 278 279
		if [ -r /var/run/portal_daemon.pid ]; then
			kill `cat /var/run/portal_daemon.pid`
		fi
280 281 282
		if [ -r /var/run/poolmonitor.pid ]; then
			kill `cat /var/run/poolmonitor.pid`
		fi
283 284 285
		if [ -r /var/run/tcppd.pid ]; then
			kill `cat /var/run/tcppd.pid`
		fi
286 287 288
		if [ -r /var/run/event_watchdog.pid ]; then
			kill `cat /var/run/event_watchdog.pid`
		fi
289 290 291
		if [ -r /var/run/apt_daemon.pid ]; then
			kill `cat /var/run/apt_daemon.pid`
		fi
292 293 294
		if [ -r /var/run/apt_scheduler.pid ]; then
			kill `cat /var/run/apt_scheduler.pid`
		fi
295 296 297
		if [ -r /var/run/aptevent_daemon.pid ]; then
			kill `cat /var/run/aptevent_daemon.pid`
		fi
298 299 300
		if [ -r /var/run/cnetwatch.pid ]; then
			kill `cat /var/run/cnetwatch.pid`
		fi
Leigh B Stoller's avatar
Leigh B Stoller committed
301 302 303
		if [ -r /var/run/apt_checkup.pid ]; then
			kill `cat /var/run/apt_checkup.pid`
		fi
Leigh B Stoller's avatar
Leigh B Stoller committed
304 305 306
		if [ -r /var/run/portal_monitor.pid ]; then
			kill `cat /var/run/portal_monitor.pid`
		fi
307 308 309
		if [ -r /var/run/portal_resources.pid ]; then
			kill `cat /var/run/portal_resources.pid`
		fi
310 311 312
		if [ -r /var/run/attend.pid ]; then
			kill `cat /var/run/attend.pid`
		fi
313 314 315 316 317 318
		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
319 320 321
		if [ -r /var/run/reportboot_daemon.pid ]; then
			kill `cat /var/run/reportboot_daemon.pid`
		fi
322 323 324 325 326 327 328 329 330

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