aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/toaster56
1 files changed, 39 insertions, 17 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index bc439e6d3a..e976604c5c 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -59,29 +59,50 @@ webserverStartAll()
python $BBBASEDIR/lib/toaster/manage.py syncdb --noinput || retval=1
python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2
+
if [ $retval -eq 1 ]; then
- echo "Failed db sync, stopping system start" 1>&2
- elif [ $retval -eq 2 ]; then
- printf "\nError on migration, trying to recover... \n"
+ echo "Failed db sync, aborting system start" 1>&2
+ return $retval
+ fi
+
+ python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
+
+ if [ $retval -eq 1 ]; then
+ printf "\nError on orm migration, rolling back...\n"
python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake
- retval=0
- python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
+ return $retval
fi
+
+ python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1
+
+ if [ $retval -eq 1 ]; then
+ printf "\nError on bldcontrol migration, rolling back...\n"
+ python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol 0001_initial --fake
+ return $retval
+ fi
+
if [ "$TOASTER_MANAGED" = '1' ]; then
- python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1
- python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1
+ python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1
fi
- if [ $retval -eq 0 ]; then
- echo "Starting webserver..."
- python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
- sleep 1
- if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
- retval=1
- rm "${BUILDDIR}/.toastermain.pid"
- else
- echo "Webserver address: http://0.0.0.0:$WEB_PORT/"
- fi
+
+ if [ $retval -eq 1 ]; then
+ printf "\nError while checking settings; aborting\n"
+ return $retval
+ fi
+
+ echo "Starting webserver..."
+
+ python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
+
+ sleep 1
+
+ if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
+ retval=1
+ rm "${BUILDDIR}/.toastermain.pid"
+ else
+ echo "Webserver address: http://0.0.0.0:$WEB_PORT/"
fi
+
return $retval
}
@@ -375,3 +396,4 @@ case $CMD in
echo "Successful ${CMD}."
;;
esac
+