summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-04-06 17:46:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:00:09 +0100
commit3fbd8534149e87c5a5d1bc1691711cfca05cafd1 (patch)
tree3c4680ac9e61ddfc7a55dbae7bbc63e6481257b7 /bin
parent6140d0cc9aecf1029ca16fed47071dfcc92f4269 (diff)
downloadbitbake-contrib-3fbd8534149e87c5a5d1bc1691711cfca05cafd1.tar.gz
toaster: don't start bitbake server
>From now on toaster script will not run bitbake server. It will be started by runbuilds and stopped after the build. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/toaster67
1 files changed, 6 insertions, 61 deletions
diff --git a/bin/toaster b/bin/toaster
index d409554d1..6a85ae255 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
-# Usage: source toaster [start|stop|restart-bitbake]
+# Usage: source toaster [start|stop]
# [webport=<port>] [noui] [noweb]
# Helper function to kill a background toaster development server
@@ -95,7 +95,6 @@ stop_system()
kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null
rm ${BUILDDIR}/.toasterui.pid
fi
- stop_bitbake
webserverKillAll
# unset exported variables
unset DATABASE_URL
@@ -106,31 +105,6 @@ stop_system()
INSTOPSYSTEM=0
}
-start_bitbake() {
- unset BBSERVER
- bitbake --read conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
- if [ $? -ne 0 ]; then
- echo "Bitbake server start failed"
- return 1
- fi
- export BBSERVER=0.0.0.0:-1
- export DATABASE_URL=`$MANAGE get-dburl`
- # we start the TOASTERUI only if not inhibited
- if [ $NOTOASTERUI -eq 0 ]; then
- bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc \
- >>${BUILDDIR}/toaster_ui.log 2>&1 \
- & echo $! >${BUILDDIR}/.toasterui.pid
- fi
- return 0
-}
-
-stop_bitbake() {
- BBSERVER=0.0.0.0:-1 bitbake -m
- unset BBSERVER
- # force stop any misbehaving bitbake server
- lsof -t bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
-}
-
verify_prereq() {
# Verify Django version
reqfile=$(python -c "import os; print os.path.realpath('$BBBASEDIR/toaster-requirements.txt')")
@@ -229,15 +203,6 @@ if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
return 1
fi
-if [ "$1" = 'restart-bitbake' ] ; then
- stop_bitbake
- sleep 1
- start_bitbake
- rc=$?
- sleep 3
- return $rc
-fi
-
verify_prereq || return 1
# We make sure we're running in the current shell and in a good environment
@@ -281,16 +246,6 @@ case $CMD in
$MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
fi
- # Make sure it's safe to start by checking bitbake lock
- if [ -e $BUILDDIR/bitbake.lock ]; then
- python -c "import fcntl; fcntl.flock(open(\"$BUILDDIR/bitbake.lock\"), fcntl.LOCK_EX|fcntl.LOCK_NB)" 2>/dev/null
- if [ $? -ne 0 ] ; then
- echo "Error: bitbake lock state error. File locks show that the system is on." 1>&2
- echo "Please wait for the current build to finish, stop and then start the system again." 1>&2
- return 3
- fi
- fi
-
# kill Toaster web server if it's alive
if [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then
echo "Warning: bitbake appears to be dead, but the Toaster web server is running." 1>&2
@@ -308,22 +263,12 @@ case $CMD in
echo "Failed ${CMD}."
return 4
fi
- start_bitbake
- if [ $? -eq 0 ]; then
- $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
- # set fail safe stop system on terminal exit
- trap stop_system SIGHUP
- echo "Successful ${CMD}."
- return 0
- else
- # failed start, do stop
- stop_system
- echo "Failed ${CMD}."
- return 1
- fi
- # stop system on terminal exit
- set -o monitor
+ export DATABASE_URL=`$MANAGE get-dburl`
+ $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
+ # set fail safe stop system on terminal exit
trap stop_system SIGHUP
+ echo "Successful ${CMD}."
+ return 0
;;
stop )
stop_system