Просмотр исходного кода

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

Daniel Gibbs 2 лет назад
Родитель
Сommit
cfdfcc3d7f
2 измененных файлов с 7 добавлено и 1 удалено
  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}"
 		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
 }

+ 5 - 1
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