aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-10-27 01:36:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-27 08:31:17 +0100
commitefbd9d54f57be7a7a10f0b56e7e62c25974e99e6 (patch)
treec994ca24034a0ea895dc56c13dc9a288c3990c73 /bin
parentbaeaa73df2e2f2edc98f8779d57f3841d382d8fc (diff)
downloadbitbake-efbd9d54f57be7a7a10f0b56e7e62c25974e99e6.tar.gz
toaster: Write logs to BUILDDIR/toaster_logs
Fixes "2efb14648 toaster: Monitoring - implement Django logging system" when running in a container. When running in a container, the previous approach of using BASE_DIR is not a writable path. Also, we really do not want to be writing logs into the source tree, as the BASE_DIR was resolving to bitbake/lib/toaster/logs Since Toaster is only ever running in an environment where oe-init-buildenv or similar has been sourced, we should instead write the logs to BUILDDIR. Using BUILDDIR to logs make path writable but django-log-viewer does'nt manage to write logs using an absolute path as BUILDDIR, where the existing toaster_ui.log was already being written. Also drop the /logs/ directory, as it has not been created which also breaks in a container environment To handle the constraints linked to django-log-viewer and /logs/, we've updated bitbake/bin/toaster to create a toaster_logs/ directory in BUILDDIR if it doesn't exist, when toaster starts up. Also manage to set BUILDDIR/toaster_logs/ as default location for toaster logs. Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Tim Orling <tim.orling@konsulko.com> Tested-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/toaster12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/toaster b/bin/toaster
index 558a81957..f002c8c15 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -84,7 +84,7 @@ webserverStartAll()
echo "Starting webserver..."
$MANAGE runserver --noreload "$ADDR_PORT" \
- </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
+ </dev/null >>${TOASTER_LOGS_DIR}/web.log 2>&1 \
& echo $! >${BUILDDIR}/.toastermain.pid
sleep 1
@@ -181,6 +181,14 @@ WEBSERVER=1
export TOASTER_BUILDSERVER=1
ADDR_PORT="localhost:8000"
TOASTERDIR=`dirname $BUILDDIR`
+# ${BUILDDIR}/toaster_logs/ became the default location for toaster logs
+# This is needed for implemented django-log-viewer: https://pypi.org/project/django-log-viewer/
+# If the directory does not exist, create it.
+TOASTER_LOGS_DIR="${BUILDDIR}/toaster_logs/"
+if [ ! -d $TOASTER_LOGS_DIR ]
+then
+ mkdir $TOASTER_LOGS_DIR
+fi
unset CMD
for param in $*; do
case $param in
@@ -299,7 +307,7 @@ case $CMD in
export BITBAKE_UI='toasterui'
if [ $TOASTER_BUILDSERVER -eq 1 ] ; then
$MANAGE runbuilds \
- </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \
+ </dev/null >>${TOASTER_LOGS_DIR}/toaster_runbuilds.log 2>&1 \
& echo $! >${BUILDDIR}/.runbuilds.pid
else
echo "Toaster build server not started."