All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH 12/26] toaster: implement start_bitbake function
Date: Thu, 12 Nov 2015 14:04:35 +0200	[thread overview]
Message-ID: <a07b67f08ffaa84e6b0cc401ad041b478e7bef65.1447328915.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1447328915.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1447328915.git.ed.bartosh@linux.intel.com>

Separated functionality of starting bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/bin/toaster | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index a532a97..b664559 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -133,6 +133,22 @@ stop_system()
     INSTOPSYSTEM=0
 }
 
+start_bitbake() {
+    unset BBSERVER
+    bitbake --read conf/toaster-pre.conf --postread 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=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
+    if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
+        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
@@ -284,28 +300,15 @@ fi
 
 case $CMD in
     start )
-        start_success=1
         addtoConfiguration toaster.conf "INHERIT+=\"toaster buildhistory\"" $TOASTER_BRBE
         echo > ${BUILDDIR}/conf/toaster-pre.conf
         if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
             echo "Failed ${CMD}."
             return 4
         fi
-        unset BBSERVER
-        bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
-        if [ $? -ne 0 ]; then
-            start_success=0
-            echo "Bitbake server start failed"
-        else
-            export BBSERVER=0.0.0.0:-1
-            export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl`
-            if [ $NOTOASTERUI -eq 0 ]; then        # we start the TOASTERUI only if not inhibited
-                bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc >>${BUILDDIR}/toaster_ui.log 2>&1 \
-                    & echo $! >${BUILDDIR}/.toasterui.pid
-            fi
+        start_bitbake
+        if [ $? -eq 0 ]; then
             python $BBBASEDIR/lib/toaster/manage.py runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
-        fi
-        if [ $start_success -eq 1 ]; then
             # set fail safe stop system on terminal exit
             trap stop_system SIGHUP
             echo "Successful ${CMD}."
-- 
2.1.4



  parent reply	other threads:[~2015-11-12 12:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 11:55 [PATCH v4 00/26] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
2015-11-12 11:55 ` [PATCH 01/26] toaster: don't allow to run toaster as a script Ed Bartosh
2015-11-12 11:55 ` [PATCH 02/26] toaster: implement get-dburl command Ed Bartosh
2015-11-12 11:55 ` [PATCH 03/26] toaster: set DATABASE_URL in toaster script Ed Bartosh
2015-11-12 11:55 ` [PATCH 04/26] toaster: run bitbake the same way Ed Bartosh
2015-11-12 11:55 ` [PATCH 05/26] toaster: remove unused variable Ed Bartosh
2015-11-12 11:55 ` [PATCH 06/26] toaster: check for toaster configuration later Ed Bartosh
2015-11-12 11:55 ` [PATCH 07/26] toaster: use parent of the build dir Ed Bartosh
2015-11-12 11:55 ` [PATCH 08/26] toaster: make runbuilds to loop Ed Bartosh
2015-11-12 12:04 ` [PATCH 09/26] toaster: start 'manage.py runbuilds' in the script Ed Bartosh
2015-11-12 12:04 ` [PATCH 10/26] toaster: update brbe and project attributes Ed Bartosh
2015-11-12 12:04 ` [PATCH 11/26] toaster: implement stop_bitbake function Ed Bartosh
2015-11-12 12:04 ` Ed Bartosh [this message]
2015-11-12 12:04 ` [PATCH 13/26] toaster: implement 'toaster restart-bitbake' Ed Bartosh
2015-11-12 12:04 ` [PATCH 14/26] toaster: remove _setupBE function Ed Bartosh
2015-11-12 12:04 ` [PATCH 15/26] toaster: reimplemented startBBServer method Ed Bartosh
2015-11-12 12:04 ` [PATCH 16/26] toaster: remove stopBBServer API Ed Bartosh
2015-11-12 12:04 ` [PATCH 17/26] toaster: do not terminate bb server Ed Bartosh
2015-11-12 12:04 ` [PATCH 18/26] toaster: remove usage of BUILD_MODE variable Ed Bartosh
2015-11-12 12:04 ` [PATCH 19/26] toaster: do not create duplicate HelpText objects Ed Bartosh
2015-11-12 12:04 ` [PATCH 20/26] toaster: buildinfohelper Broaden the toaster created recipe data case Ed Bartosh
2015-11-12 12:04 ` [PATCH 21/26] toaster: implement BitbakeController.getVariable Ed Bartosh
2015-11-12 12:04 ` [PATCH 22/26] toaster: set varibales on bitbake server Ed Bartosh
2015-11-12 12:04 ` [PATCH 23/26] toaster: remove writeConfFile API Ed Bartosh
2015-11-12 12:04 ` [PATCH 24/26] toaster: stop using toaster-pre.conf Ed Bartosh
2015-11-12 12:04 ` [PATCH 25/26] toaster: remove SDKMACHINE from project variables Ed Bartosh
2015-11-12 12:04 ` [PATCH 26/26] toaster: get rid of complicated heuristics Ed Bartosh
2015-11-16 18:40 ` [PATCH v4 00/26] toaster: 8279: Provide a single way of starting Toaster Brian Avery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a07b67f08ffaa84e6b0cc401ad041b478e7bef65.1447328915.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.