Changeset 58591 in vbox for trunk/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh
- Timestamp:
- Nov 5, 2015 7:13:45 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh
r56295 r58591 38 38 39 39 PATH=$PATH:/bin:/sbin:/usr/sbin 40 SCRIPTNAME=vboxtxs.sh 40 41 41 42 CDROM_PATH=/media/cdrom 42 43 SCRATCH_PATH=/tmp/vboxtxs-scratch 43 44 44 system=unknown 45 if [ -f /etc/redhat-release ]; then 46 system=redhat 47 PIDFILE="/var/lock/subsys/vboxtxs" 48 elif [ -f /etc/SuSE-release ]; then 49 system=suse 50 PIDFILE="/var/lock/subsys/vboxtxs" 51 elif [ -f /etc/debian_version ]; then 52 system=debian 53 PIDFILE="/var/run/vboxtxs" 54 elif [ -f /etc/gentoo-release ]; then 55 system=gentoo 56 PIDFILE="/var/run/vboxtxs" 57 elif [ -f /etc/arch-release ]; then 58 system=arch 59 PIDFILE="/var/run/vboxtxs" 60 elif [ -f /etc/slackware-version ]; then 61 system=slackware 62 PIDFILE="/var/run/vboxtxs" 63 elif [ -f /etc/lfs-release ]; then 64 system=lfs 65 PIDFILE="/var/run/vboxtxs.pid" 66 else 67 system=other 68 if [ -d /var/run -a -w /var/run ]; then 69 PIDFILE="/var/run/vboxtxs" 70 fi 45 PIDFILE="/var/run/vboxtxs" 46 47 # Preamble for Gentoo 48 if [ "`which $0`" = "/sbin/rc" ]; then 49 shift 71 50 fi 72 51 73 if [ "$system" = "redhat" ]; then 74 . /etc/init.d/functions 75 fail_msg() { 76 echo_failure 77 echo 78 } 52 begin_msg() 53 { 54 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 55 logger -t "${SCRIPTNAME}" "${1}." 56 } 79 57 80 succ_msg() { 81 echo_success 82 echo83 58 succ_msg() 59 { 60 logger -t "${SCRIPTNAME}" "${1}." 61 } 84 62 85 begin() { 86 echo -n "$1" 87 } 88 fi 63 fail_msg() 64 { 65 echo "${SCRIPTNAME}: failed: ${1}." >&2 66 logger -t "${SCRIPTNAME}" "failed: ${1}." 67 } 89 68 90 if [ "$system" = "suse" ]; then 91 . /etc/rc.status 92 daemon() { 93 startproc ${1+"$@"} 94 } 95 96 fail_msg() { 97 rc_failed 1 98 rc_status -v 99 } 100 101 succ_msg() { 102 rc_reset 103 rc_status -v 104 } 105 106 begin() { 107 echo -n "$1" 108 } 109 fi 110 111 if [ "$system" = "debian" ]; then 112 daemon() { 113 start-stop-daemon --start --exec $1 -- $2 114 } 115 116 killproc() { 117 start-stop-daemon --stop --exec $@ 118 } 119 120 fail_msg() { 121 echo " ...fail!" 122 } 123 124 succ_msg() { 125 echo " ...done." 126 } 127 128 begin() { 129 echo -n "$1" 130 } 131 fi 132 133 if [ "$system" = "gentoo" ]; then 134 if [ -f /sbin/functions.sh ]; then 135 . /sbin/functions.sh 136 elif [ -f /etc/init.d/functions.sh ]; then 137 . /etc/init.d/functions.sh 138 fi 139 daemon() { 140 start-stop-daemon --start --exec $1 -- $2 141 } 142 143 killproc() { 144 start-stop-daemon --stop --exec $@ 145 } 146 147 fail_msg() { 148 echo " ...fail!" 149 } 150 151 succ_msg() { 152 echo " ...done." 153 } 154 155 begin() { 156 echo -n "$1" 157 } 158 159 if [ "`which $0`" = "/sbin/rc" ]; then 160 shift 161 fi 162 fi 163 164 if [ "$system" = "arch" ]; then 165 USECOLOR=yes 166 . /etc/rc.d/functions 167 daemon() { 168 $@ 169 test $? -eq 0 && add_daemon rc.`basename $1` 170 } 171 172 killproc() { 173 killall $@ 174 rm_daemon `basename $@` 175 } 176 177 fail_msg() { 178 stat_fail 179 } 180 181 succ_msg() { 182 stat_done 183 } 184 185 begin() { 186 stat_busy "$1" 187 } 188 189 fi 190 191 if [ "$system" = "slackware" ]; then 192 daemon() { 193 $1 $2 194 } 195 196 killproc() { 197 killall $1 198 rm -f $PIDFILE 199 } 200 201 fail_msg() { 202 echo " ...fail!" 203 } 204 205 succ_msg() { 206 echo " ...done." 207 } 208 209 begin() { 210 echo -n "$1" 211 } 212 213 fi 214 215 if [ "$system" = "lfs" ]; then 216 . /etc/rc.d/init.d/functions 217 daemon() { 218 loadproc $1 $2 219 } 220 221 fail_msg() { 222 echo_failure 223 } 224 225 succ_msg() { 226 echo_ok 227 } 228 229 begin() { 230 echo $1 231 } 232 233 status() { 234 statusproc $1 235 } 236 fi 237 238 if [ "$system" = "other" ]; then 239 fail_msg() { 240 echo " ...fail!" 241 } 242 243 succ_msg() { 244 echo " ...done." 245 } 246 247 begin() { 248 echo -n "$1" 249 } 250 fi 69 killproc() { 70 kp_binary="${1##*/}" 71 pkill "${kp_binary}" || return 0 72 sleep 1 73 pkill "${kp_binary}" || return 0 74 sleep 1 75 pkill -9 "${kp_binary}" 76 return 0 77 } 251 78 252 79 case "`uname -m`" in … … 274 101 start() { 275 102 if ! test -f $PIDFILE; then 276 begin "Starting VirtualBox Test Execution Service ";103 begin_msg "Starting VirtualBox Test Execution Service" console 277 104 fixAndTestBinary 278 105 mount /dev/cdrom "${CDROM_PATH}" 2> /dev/null > /dev/null 279 daemon$binary --auto-upgrade --scratch="${SCRATCH_PATH}" --cdrom="${CDROM_PATH}" --no-display-output > /dev/null106 $binary --auto-upgrade --scratch="${SCRATCH_PATH}" --cdrom="${CDROM_PATH}" --no-display-output > /dev/null 280 107 RETVAL=$? 281 108 test $RETVAL -eq 0 && sleep 2 && echo `pidof TestExecService` > $PIDFILE … … 284 111 fi 285 112 if test $RETVAL -eq 0; then 286 succ_msg 113 succ_msg "VirtualBox Test Execution service started" 287 114 else 288 fail_msg 115 fail_msg "VirtualBox Test Execution service failed to start" 289 116 fi 290 117 fi … … 294 121 stop() { 295 122 if test -f $PIDFILE; then 296 begin "Stopping VirtualBox Test Execution Service ";123 begin_msg "Stopping VirtualBox Test Execution Service" console 297 124 killproc $binary 298 RETVAL=$?299 test $RETVAL -eq 0 && rm -f $PIDFILE300 succ_msg301 125 fi 302 return $RETVAL303 126 } 304 127
Note:
See TracChangeset
for help on using the changeset viewer.