From 5b9b6921d120c462754985f2969c4121dd2d97af Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 15 Feb 2023 14:06:37 +0100 Subject: [debug-report-bwlp] Add useful params to some tools Also add a fallback for determining XAUTHORITY --- .../debug-report-bwlp/data/opt/openslx/bin/debug_report | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/modules/debug-report-bwlp') diff --git a/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report b/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report index 565ec026..00eca9d6 100755 --- a/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report +++ b/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report @@ -1,17 +1,17 @@ #!/bin/bash # bash because of {,} expansion -TOOLS=" - journalctl +TOOLS=( + "journalctl -a" systemctl loginctl - lspci + "lspci -nn" lsusb lsmod mount dmesg dmidecode -" +) URLS=" https://bwlp-masterserver.ruf.uni-freiburg.de/error_report.php @@ -107,8 +107,8 @@ cp /run/openslx/*log* /run/openslx/dmsetup.state static/ 2> /dev/null cp -r /opt/openslx/.mltk static/ 2> /dev/null echo -n "." -for tool in $TOOLS; do - $tool > "generated/${tool}-out" 2> "generated/${tool}-err" +for tool in "${TOOLS[@]}"; do + $tool > "generated/${tool%% *}-out" 2> "generated/${tool%% *}-err" echo -n "." done @@ -142,6 +142,7 @@ echo -n "." if [ -z "$DISPLAY" ]; then DISPLAY=:0 XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}') + [ -z "$XAUTHORITY" ] && [ -s "/run/lightdm/root/:0" ] && XAUTHORITY="/run/lightdm/root/:0" fi if [ -n "$XAUTHORITY" ]; then export DISPLAY -- cgit v1.2.3-55-g7522