From a74e4d046a0d744d44677c681c1e713e6c947ec4 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 1 Dec 2025 21:04:01 +0000 Subject: [PATCH] fix: add timeout to pmxcfs operations in install-sensor-proxy.sh Reading and writing container config from /etc/pve/lxc/ can hang indefinitely if the Proxmox cluster filesystem (pmxcfs) is slow or unresponsive. This causes the installer to appear to hang after "Configuring socket bind mount..." with no further output. Add 10-second timeouts to both cp operations and provide helpful error messages suggesting the user check cluster health with 'pvecm status'. Related to #738 --- scripts/install-sensor-proxy.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/install-sensor-proxy.sh b/scripts/install-sensor-proxy.sh index 8afa8e7..2850976 100755 --- a/scripts/install-sensor-proxy.sh +++ b/scripts/install-sensor-proxy.sh @@ -3215,7 +3215,14 @@ if [[ "$STANDALONE" == false && "$CONTAINER_ON_THIS_NODE" == true ]]; then # Must use temp file and copy back to trigger cluster sync # Also, config file contains snapshots sections - only modify main section (before first [) TEMP_CONFIG=$(mktemp) - cp "$LXC_CONFIG" "$TEMP_CONFIG" + print_info "Reading container config from $LXC_CONFIG..." + if ! timeout 10 cp "$LXC_CONFIG" "$TEMP_CONFIG" 2>/dev/null; then + print_error "Timed out or failed reading container config from $LXC_CONFIG" + print_error "The Proxmox cluster filesystem (pmxcfs) may be slow or unresponsive." + print_error "Try: pvecm status # to check cluster health" + rm -f "$TEMP_CONFIG" + exit 1 + fi # Extract line number where snapshots start (first line starting with [) SNAPSHOT_START=$(grep -n '^\[' "$TEMP_CONFIG" | head -1 | cut -d: -f1) @@ -3256,7 +3263,13 @@ if [[ "$STANDALONE" == false && "$CONTAINER_ON_THIS_NODE" == true ]]; then # Copy back to trigger pmxcfs sync if [[ "$MOUNT_UPDATED" = true ]]; then - cp "$TEMP_CONFIG" "$LXC_CONFIG" + print_info "Writing updated config to $LXC_CONFIG..." + if ! timeout 10 cp "$TEMP_CONFIG" "$LXC_CONFIG" 2>/dev/null; then + print_error "Timed out or failed writing container config to $LXC_CONFIG" + print_error "The Proxmox cluster filesystem (pmxcfs) may be slow or unresponsive." + rm -f "$TEMP_CONFIG" + exit 1 + fi fi rm -f "$TEMP_CONFIG"