From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 13B6FE00C2B; Thu, 12 Nov 2015 04:38:34 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.93 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 28BBBE00C21 for ; Thu, 12 Nov 2015 04:38:17 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 12 Nov 2015 04:38:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,281,1444719600"; d="scan'208";a="849426754" Received: from linux.intel.com ([10.23.219.25]) by fmsmga002.fm.intel.com with ESMTP; 12 Nov 2015 04:38:17 -0800 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id 0E8196A4083 for ; Thu, 12 Nov 2015 04:37:11 -0800 (PST) From: Ed Bartosh To: toaster@yoctoproject.org Date: Thu, 12 Nov 2015 14:04:35 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH 12/26] toaster: implement start_bitbake function X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 12:38:34 -0000 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 --- 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