From cfdfcc3d7f1bff6537718ef3e89844349e1e76be Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 28 Oct 2023 12:59:49 +0100 Subject: [PATCH] feat: dev-debug.log moved to /data/log if running in docker --- lgsm/modules/core_exit.sh | 2 ++ linuxgsm.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index 496cde422..989a4c543 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -13,6 +13,8 @@ fn_exit_dev_debug() { echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + elif [ -f "${lgsmlogdir}/dev-debug.log" ]; then + grep -a "modulefile=" "${lgsmlogdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" fi fi } diff --git a/linuxgsm.sh b/linuxgsm.sh index 395285c7b..9f3611fed 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -15,7 +15,11 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5> dev-debug.log + if [ -f /.dockerenv ]; then + exec 5> /data/log/dev-debug.log + else + exec 5> dev-debug.log + fi BASH_XTRACEFD="5" set -x fi