Explorar o código

feat: dev-debug.log moved to /data/log if running in docker

Daniel Gibbs %!s(int64=2) %!d(string=hai) anos
pai
achega
cfdfcc3d7f
Modificáronse 2 ficheiros con 7 adicións e 1 borrados
  1. 2 0
      lgsm/modules/core_exit.sh
  2. 5 1
      linuxgsm.sh

+ 2 - 0
lgsm/modules/core_exit.sh

@@ -13,6 +13,8 @@ fn_exit_dev_debug() {
 		echo -e "${moduleselfname} exiting with code: ${exitcode}"
 		echo -e "${moduleselfname} exiting with code: ${exitcode}"
 		if [ -f "${rootdir}/dev-debug.log" ]; then
 		if [ -f "${rootdir}/dev-debug.log" ]; then
 			grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log"
 			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
 	fi
 	fi
 }
 }

+ 5 - 1
linuxgsm.sh

@@ -15,7 +15,11 @@
 
 
 # Debugging
 # Debugging
 if [ -f ".dev-debug" ]; then
 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"
 	BASH_XTRACEFD="5"
 	set -x
 	set -x
 fi
 fi