summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-02 10:02:44 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-07 17:22:59 +0000
commitd8e9ce7ba3f5b89c51e769bd4a46c2026a110d40 (patch)
treee1a7f50890a6da88e35019cc1855bb81c8c1a735 /bin
parentdd40d70b707a3ff59edfa69923d4d9b671928a66 (diff)
downloadbitbake-d8e9ce7ba3f5b89c51e769bd4a46c2026a110d40.tar.gz
toaster: implement start_bitbake function
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> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/toaster33
1 files changed, 18 insertions, 15 deletions
diff --git a/bin/toaster b/bin/toaster
index e82df9b80..34a4e8f6f 100755
--- a/bin/toaster
+++ b/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
@@ -324,28 +340,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}."