Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 87DD6E009D9; Tue, 27 Oct 2015 10:32:05 -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.24 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id C9B75E00708 for ; Tue, 27 Oct 2015 10:32:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 27 Oct 2015 10:32:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,206,1444719600"; d="scan'208";a="836326635" Received: from linux.intel.com ([10.23.219.25]) by orsmga002.jf.intel.com with ESMTP; 27 Oct 2015 10:32:01 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id 92B956A4005 for ; Tue, 27 Oct 2015 10:30:59 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Tue, 27 Oct 2015 19:28:08 +0200 Message-Id: <87068f0fa7ffb44ec3245d69a1bddd52114e76bc.1445966717.git.ed.bartosh@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH 11/25] toaster: implement stop_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: Tue, 27 Oct 2015 17:32:05 -0000 Separated functionality of stopping 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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 7117608..a532a97 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster @@ -126,16 +126,20 @@ stop_system() kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null rm ${BUILDDIR}/.toasterui.pid fi - BBSERVER=0.0.0.0:-1 bitbake -m - unset BBSERVER + stop_bitbake webserverKillAll - # force stop any misbehaving bitbake server - lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill trap - SIGHUP #trap - SIGCHLD INSTOPSYSTEM=0 } +stop_bitbake() { + BBSERVER=0.0.0.0:-1 bitbake -m + unset BBSERVER + # force stop any misbehaving bitbake server + lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill +} + check_pidbyfile() { [ -e $1 ] && kill -0 `cat $1` 2>/dev/null } -- 2.1.4