From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id A1643E00951; Wed, 23 Mar 2016 03:36:07 -0700 (PDT) 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 * [134.134.136.65 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id CB15DE00920 for ; Wed, 23 Mar 2016 03:36:06 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 23 Mar 2016 03:36:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,382,1455004800"; d="scan'208,223";a="943320443" Received: from linux.intel.com ([10.23.219.25]) by fmsmga002.fm.intel.com with ESMTP; 23 Mar 2016 03:36:06 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id 5DD7E6A4006 for ; Wed, 23 Mar 2016 04:23:49 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Wed, 23 Mar 2016 10:14:52 +0200 Message-Id: <4a3b51f7f4e71416e6369478f4bfb6296c3eb198.1458720709.git.ed.bartosh@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH v6 01/41] toaster: don't start bitbake server 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: Wed, 23 Mar 2016 10:36:07 -0000 >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 --- bitbake/bin/toaster | 67 +++++------------------------------------------------ 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index d409554..6a85ae2 100755 --- a/bitbake/bin/toaster +++ b/bitbake/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=] [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 -- 2.1.4