bitbake: toaster: don't start bitbake server
>From now on toaster script will not run bitbake server. It will be started by runbuilds and stopped after the build. (Bitbake rev: 3fbd8534149e87c5a5d1bc1691711cfca05cafd1) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
4127fef8ba
commit
f77baec6de
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
# 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=<port>] [noui] [noweb]
|
# [webport=<port>] [noui] [noweb]
|
||||||
|
|
||||||
# Helper function to kill a background toaster development server
|
# Helper function to kill a background toaster development server
|
||||||
|
@ -95,7 +95,6 @@ stop_system()
|
||||||
kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null
|
kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null
|
||||||
rm ${BUILDDIR}/.toasterui.pid
|
rm ${BUILDDIR}/.toasterui.pid
|
||||||
fi
|
fi
|
||||||
stop_bitbake
|
|
||||||
webserverKillAll
|
webserverKillAll
|
||||||
# unset exported variables
|
# unset exported variables
|
||||||
unset DATABASE_URL
|
unset DATABASE_URL
|
||||||
|
@ -106,31 +105,6 @@ stop_system()
|
||||||
INSTOPSYSTEM=0
|
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_prereq() {
|
||||||
# Verify Django version
|
# Verify Django version
|
||||||
reqfile=$(python -c "import os; print os.path.realpath('$BBBASEDIR/toaster-requirements.txt')")
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = 'restart-bitbake' ] ; then
|
|
||||||
stop_bitbake
|
|
||||||
sleep 1
|
|
||||||
start_bitbake
|
|
||||||
rc=$?
|
|
||||||
sleep 3
|
|
||||||
return $rc
|
|
||||||
fi
|
|
||||||
|
|
||||||
verify_prereq || return 1
|
verify_prereq || return 1
|
||||||
|
|
||||||
# We make sure we're running in the current shell and in a good environment
|
# 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
|
$MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
|
||||||
fi
|
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
|
# kill Toaster web server if it's alive
|
||||||
if [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then
|
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
|
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}."
|
echo "Failed ${CMD}."
|
||||||
return 4
|
return 4
|
||||||
fi
|
fi
|
||||||
start_bitbake
|
export DATABASE_URL=`$MANAGE get-dburl`
|
||||||
if [ $? -eq 0 ]; then
|
$MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
|
||||||
$MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
|
# set fail safe stop system on terminal exit
|
||||||
# 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
|
|
||||||
trap stop_system SIGHUP
|
trap stop_system SIGHUP
|
||||||
|
echo "Successful ${CMD}."
|
||||||
|
return 0
|
||||||
;;
|
;;
|
||||||
stop )
|
stop )
|
||||||
stop_system
|
stop_system
|
||||||
|
|
Loading…
Reference in New Issue