3.testbed.sh.in 4.83 KB
Newer Older
1 2 3 4
#!/bin/sh
#
# Utah Network Testbed local startup
#
5 6

# PROVIDE: testbed
7
# REQUIRE: mysql pubsub mfrisbeed
8 9 10
# BEFORE: apache22
# KEYWORD: shutdown

11
case "$1" in
12
	start|faststart)
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
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
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
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

80 81 82 83 84
		if [ -x @prefix@/sbin/checkup_daemon  ]; then
			echo -n " checkupd"
			@prefix@/sbin/checkup_daemon
		fi

Leigh Stoller's avatar
Leigh Stoller committed
85 86 87 88 89
		if [ -x @prefix@/sbin/pool_daemon  ]; then
			echo -n " poold"
			@prefix@/sbin/pool_daemon
		fi

90 91 92 93
		if [ -x @prefix@/sbin/mysqld_watchdog  ]; then
			echo -n " mysqld_watchdog"
			@prefix@/sbin/mysqld_watchdog
		fi
94

Leigh Stoller's avatar
Leigh 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/checknodes_daemon  ]; then
			echo -n " checknodes_daemon"
			@prefix@/sbin/checknodes_daemon
		fi

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

120 121 122 123 124
		#
		# Could trigger experiment creation, so make sure everything
		# else is setup first; i.e., run this last!
		#
		if [ -x @prefix@/sbin/batch_daemon  ]; then
125 126 127 128 129 130 131 132
			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
133 134 135
		fi
		;;
	stop)
136 137
		if [ -r /var/run/bootinfo.pid ]; then
			kill `cat /var/run/bootinfo.pid`
138 139 140 141
		fi
		if [ -r /var/run/tmcd.pid ]; then
			kill `cat /var/run/tmcd.pid`
		fi
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
		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
		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
178 179 180
		if [ -r /var/run/ch_daemon.pid ]; then
			kill `cat /var/run/ch_daemon.pid`
		fi
181 182 183
		if [ -r /var/run/checknodes.pid ]; then
			kill `cat /var/run/checknodes.pid`
		fi
184 185 186
		if [ -r /var/run/checknodes_daemon.pid ]; then
			kill `cat /var/run/checknodes_daemon.pid`
		fi
187 188 189
		if [ -r /var/run/batch_daemon_wrapper.pid ]; then
			kill `cat /var/run/batch_daemon_wrapper.pid`
		fi
190 191 192
		if [ -r /var/run/portal_daemon.pid ]; then
			kill `cat /var/run/portal_daemon.pid`
		fi
193 194 195 196 197 198 199 200 201

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