vboxtxs.sh revision cf22150eaeeb72431bf1cf65c309a431454fb22b
## @file
# VirtualBox Test Execution Service Init Script.
#
#
# Copyright (C) 2006-2014 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#
# chkconfig: 35 35 65
# description: VirtualBox Test Execution Service
#
### BEGIN INIT INFO
# Provides: vboxtxs
# Required-Start: $network
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VirtualBox Test Execution Service
### END INIT INFO
if [ -f /etc/redhat-release ]; then
elif [ -f /etc/SuSE-release ]; then
elif [ -f /etc/debian_version ]; then
elif [ -f /etc/gentoo-release ]; then
elif [ -f /etc/arch-release ]; then
elif [ -f /etc/slackware-version ]; then
elif [ -f /etc/lfs-release ]; then
PIDFILE="/var/run/vboxtxs.pid"
else
fi
fi
if [ "$system" = "redhat" ]; then
echo
}
echo
}
echo -n "$1"
}
fi
if [ "$system" = "suse" ]; then
}
rc_status -v
}
rc_status -v
}
echo -n "$1"
}
fi
if [ "$system" = "debian" ]; then
}
}
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
if [ "$system" = "gentoo" ]; then
if [ -f /sbin/functions.sh ]; then
. /sbin/functions.sh
fi
}
}
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
shift
fi
fi
if [ "$system" = "arch" ]; then
$@
test $? -eq 0 && add_daemon rc.`basename $1`
}
killall $@
}
}
}
stat_busy "$1"
}
fi
if [ "$system" = "slackware" ]; then
$1 $2
}
killall $1
}
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
if [ "$system" = "lfs" ]; then
loadproc $1 $2
}
}
}
echo $1
}
statusproc $1
}
fi
if [ "$system" = "other" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
;;
;;
*)
;;
esac
echo "Cannot run $binary"
exit 1
}
}
if ! test -f $PIDFILE; then
daemon $binary --auto-upgrade --scratch="${SCRATCH_PATH}" --cdrom="${CDROM_PATH}" --no-display-output > /dev/null
RETVAL=$?
if ! test -s "${PIDFILE}"; then
RETVAL=5
fi
else
fi
fi
return $RETVAL
}
stop() {
if test -f $PIDFILE; then
RETVAL=$?
fi
return $RETVAL
}
stop && start
}
echo -n "Checking for vboxtxs"
if [ -f $PIDFILE ]; then
echo " ...running"
else
echo " ...not running"
fi
}
case "$1" in
;;
stop)
stop
;;
;;
;;
;;
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL