Fix watchdog timeout and MQTT connectivity issues
Problem: R5C spontaneously rebooted due to hardware watchdog timeout Cause 1: van-gps-owntracks in infinite restart loop (MQTT connect failed) Cause 2: mosquitto only listening on localhost, so clients couldn't connect Solution: - Add restart limits to van-gps-owntracks and van-li3-battery services (max 3 restarts per 5 minutes prevents infinite restart loops) - Configure mosquitto to listen on all interfaces (0.0.0.0:1883) - Deploy mosquitto listener config via deploy.sh - Restart mosquitto during deploy to apply config changes This prevents the system from hitting the 11-second hardware watchdog timeout when services crash and systemd auto-restarts them indefinitely. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
+21
-14
@@ -15,6 +15,11 @@ set -euo pipefail
|
||||
|
||||
USB_ROOT_PART=/dev/sda2
|
||||
MOUNT_POINT=/mnt/usb-backup-root
|
||||
MOUNT_POINT=10.42.1.44:/media/andreas/writable-nvme
|
||||
|
||||
|
||||
[[ "$MOUNT_POINT" == *":"* ]]
|
||||
LOCAL_MOUNT=$?
|
||||
|
||||
root_src=$(findmnt -no SOURCE /)
|
||||
if [ "$root_src" = "$USB_ROOT_PART" ]; then
|
||||
@@ -22,21 +27,23 @@ if [ "$root_src" = "$USB_ROOT_PART" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$MOUNT_POINT"
|
||||
mounted_here=0
|
||||
if ! mountpoint -q "$MOUNT_POINT"; then
|
||||
mount "$USB_ROOT_PART" "$MOUNT_POINT"
|
||||
mounted_here=1
|
||||
else
|
||||
mount -o remount,rw "$MOUNT_POINT"
|
||||
fi
|
||||
if [ $LOCAL_MOUNT -eq 1 ]; then
|
||||
mkdir -p "$MOUNT_POINT"
|
||||
mounted_here=0
|
||||
if ! mountpoint -q "$MOUNT_POINT"; then
|
||||
mount "$USB_ROOT_PART" "$MOUNT_POINT"
|
||||
mounted_here=1
|
||||
else
|
||||
mount -o remount,rw "$MOUNT_POINT"
|
||||
fi
|
||||
|
||||
cleanup() {
|
||||
if [ "$mounted_here" -eq 1 ]; then
|
||||
umount "$MOUNT_POINT"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
cleanup() {
|
||||
if [ "$mounted_here" -eq 1 ]; then
|
||||
umount "$MOUNT_POINT"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
fi
|
||||
|
||||
# rsync exit 24 ("partial transfer due to vanished source files") is expected on a
|
||||
# live root — files like container shm sockets or in-progress logs routinely disappear
|
||||
|
||||
Reference in New Issue
Block a user