summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmodules.d/slx-watchdog/hooks/s3-watchdog.sh11
-rwxr-xr-xmodules.d/slx-watchdog/module-setup.sh4
2 files changed, 11 insertions, 4 deletions
diff --git a/modules.d/slx-watchdog/hooks/s3-watchdog.sh b/modules.d/slx-watchdog/hooks/s3-watchdog.sh
index 2064ad97..3e7f342b 100755
--- a/modules.d/slx-watchdog/hooks/s3-watchdog.sh
+++ b/modules.d/slx-watchdog/hooks/s3-watchdog.sh
@@ -3,8 +3,15 @@
sleep 30 # Hopefully enough - usually takes 3-4 seconds from here
# We didn't get killed in time - send report
-. /etc/openslx
-[ -z "$SLX_REMOTE_LOG" ] && exit 1
+[ -s /etc/openslx ] && . /etc/openslx
+if [ -z "$SLX_REMOTE_LOG" ]; then
+ # Guess the URL - maybe downloading the config failed
+ slxsrv="$( grep -oPm1 '(?<=\bslxsrv=)\S*' /proc/cmdline)"
+ [ -z "$slxsrv" ] && exit 1
+ SLX_REMOTE_LOG="http://${slxsrv}/slx-admin/api.php?do=clientlog"
+fi
+
+[ -e /.console_lock ] && exit 0 # We dropped a shell, ignore
echo "SLX-Watchdog timed out, sending debug report"
journalctl -b > /tmp/journal.txt
diff --git a/modules.d/slx-watchdog/module-setup.sh b/modules.d/slx-watchdog/module-setup.sh
index 26df4a34..ca60c106 100755
--- a/modules.d/slx-watchdog/module-setup.sh
+++ b/modules.d/slx-watchdog/module-setup.sh
@@ -13,8 +13,8 @@ install() {
--requires "initrd-root-fs.target"
slx_service "s3-watchdog" "Send error report to server if we stay in stage3 for too long" \
--type "simple" \
- --after "s3-fetch-config.service" \
- --requires "s3-fetch-config.service"
+ --after "s3-setup-bootif-network.service" \
+ --requires "s3-setup-bootif-network.service"
# Try to enforce nowayout for all watchdogs
inst_simple "$moddir/data/slx-nowayout.conf" "/etc/modprobe.d/slx-nowayout.conf"
}