diff options
Diffstat (limited to 'bitbake/bin/toaster')
-rwxr-xr-x | bitbake/bin/toaster | 56 |
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() | |||
59 | python $BBBASEDIR/lib/toaster/manage.py syncdb --noinput || retval=1 | 59 | python $BBBASEDIR/lib/toaster/manage.py syncdb --noinput || retval=1 |
60 | 60 | ||
61 | python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2 | 61 | python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2 |
62 | |||
62 | if [ $retval -eq 1 ]; then | 63 | if [ $retval -eq 1 ]; then |
63 | echo "Failed db sync, stopping system start" 1>&2 | 64 | echo "Failed db sync, aborting system start" 1>&2 |
64 | elif [ $retval -eq 2 ]; then | 65 | return $retval |
65 | printf "\nError on migration, trying to recover... \n" | 66 | fi |
67 | |||
68 | python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1 | ||
69 | |||
70 | if [ $retval -eq 1 ]; then | ||
71 | printf "\nError on orm migration, rolling back...\n" | ||
66 | python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake | 72 | python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake |
67 | retval=0 | 73 | return $retval |
68 | python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1 | ||
69 | fi | 74 | fi |
75 | |||
76 | python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1 | ||
77 | |||
78 | if [ $retval -eq 1 ]; then | ||
79 | printf "\nError on bldcontrol migration, rolling back...\n" | ||
80 | python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol 0001_initial --fake | ||
81 | return $retval | ||
82 | fi | ||
83 | |||
70 | if [ "$TOASTER_MANAGED" = '1' ]; then | 84 | if [ "$TOASTER_MANAGED" = '1' ]; then |
71 | python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1 | 85 | python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1 |
72 | python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1 | ||
73 | fi | 86 | fi |
74 | if [ $retval -eq 0 ]; then | 87 | |
75 | echo "Starting webserver..." | 88 | if [ $retval -eq 1 ]; then |
76 | 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 | 89 | printf "\nError while checking settings; aborting\n" |
77 | sleep 1 | 90 | return $retval |
78 | if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then | 91 | fi |
79 | retval=1 | 92 | |
80 | rm "${BUILDDIR}/.toastermain.pid" | 93 | echo "Starting webserver..." |
81 | else | 94 | |
82 | echo "Webserver address: http://0.0.0.0:$WEB_PORT/" | 95 | 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 |
83 | fi | 96 | |
97 | sleep 1 | ||
98 | |||
99 | if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then | ||
100 | retval=1 | ||
101 | rm "${BUILDDIR}/.toastermain.pid" | ||
102 | else | ||
103 | echo "Webserver address: http://0.0.0.0:$WEB_PORT/" | ||
84 | fi | 104 | fi |
105 | |||
85 | return $retval | 106 | return $retval |
86 | } | 107 | } |
87 | 108 | ||
@@ -375,3 +396,4 @@ case $CMD in | |||
375 | echo "Successful ${CMD}." | 396 | echo "Successful ${CMD}." |
376 | ;; | 397 | ;; |
377 | esac | 398 | esac |
399 | |||