Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Fix LXC config modification for Proxmox pmxcfs filesystem
rcourtman3858397f76e7
diff --git a/install.sh b/install.shindex 44436423e2..daaa0e2e6a 100755--- a/install.sh+++ b/install.sh@@ -457,22 +457,50 @@ configure_proxy_socket_mount() {local updated=false- if grep -Eq '^mp[0-9]+: .*pulse-sensor-proxy' "$lxc_config" 2>/dev/null; then+ # /etc/pve is a FUSE filesystem (pmxcfs) - direct sed/echo don't work reliably+ # Must use temp file and copy back to trigger cluster sync+ # Also, config file contains snapshots sections - only modify main section (before first [)+ local temp_config=$(mktemp)+ cp "$lxc_config" "$temp_config"++ # Extract line number where snapshots start (first line starting with [)+ local snapshot_start=$(grep -n '^\[' "$temp_config" | head -1 | cut -d: -f1)++ if grep -Eq '^mp[0-9]+: .*pulse-sensor-proxy' "$temp_config" 2>/dev/null; thenprint_info "Removing mp entries for pulse-sensor-proxy to keep snapshots and migrations working"- sed -i '/^mp[0-9]\+: .*pulse-sensor-proxy/d' "$lxc_config"+ if [ -n "$snapshot_start" ]; then+ sed -i "1,$((snapshot_start-1)) { /^mp[0-9]\+: .*pulse-sensor-proxy/d }" "$temp_config"+ else+ sed -i '/^mp[0-9]\+: .*pulse-sensor-proxy/d' "$temp_config"+ fiupdated=truefi- if grep -q "^lxc.mount.entry: .*/pulse-sensor-proxy" "$lxc_config" 2>/dev/null; then- if ! grep -qxF "$desired_entry" "$lxc_config"; then- sed -i "s#^lxc.mount.entry: .*pulse-sensor-proxy.*#${desired_entry}#" "$lxc_config"+ if grep -q "^lxc.mount.entry: .*/pulse-sensor-proxy" "$temp_config" 2>/dev/null; then+ if ! grep -qxF "$desired_entry" "$temp_config"; then+ if [ -n "$snapshot_start" ]; then+ sed -i "1,$((snapshot_start-1)) { s#^lxc.mount.entry: .*pulse-sensor-proxy.*#${desired_entry}# }" "$temp_config"+ else+ sed -i "s#^lxc.mount.entry: .*pulse-sensor-proxy.*#${desired_entry}#" "$temp_config"+ fiupdated=truefielse- echo "$desired_entry" >> "$lxc_config"+ # Insert before snapshot section if it exists, otherwise append+ if [ -n "$snapshot_start" ]; then+ sed -i "${snapshot_start}i ${desired_entry}" "$temp_config"+ else+ echo "$desired_entry" >> "$temp_config"+ fiupdated=truefi+ # Copy back to trigger pmxcfs sync+ if [[ "$updated" == true ]]; then+ cp "$temp_config" "$lxc_config"+ fi+ rm -f "$temp_config"+if ! pct config "$ctid" | grep -qxF "$desired_entry"; thenprint_error "Failed to persist pulse-sensor-proxy mount entry in $lxc_config"return 1diff --git a/scripts/install-sensor-proxy.sh b/scripts/install-sensor-proxy.shindex 5f330c6346..015cd96e54 100755--- a/scripts/install-sensor-proxy.sh+++ b/scripts/install-sensor-proxy.sh@@ -3157,26 +3157,55 @@ if [[ "$STANDALONE" == false ]]; thenCT_RUNNING=truefi- if grep -Eq '^mp[0-9]+: .*pulse-sensor-proxy' "$LXC_CONFIG" 2>/dev/null; then+ # /etc/pve is a FUSE filesystem (pmxcfs) - direct sed/echo don't work reliably+ # 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"++ # Extract line number where snapshots start (first line starting with [)+ SNAPSHOT_START=$(grep -n '^\[' "$TEMP_CONFIG" | head -1 | cut -d: -f1)++ if grep -Eq '^mp[0-9]+: .*pulse-sensor-proxy' "$TEMP_CONFIG" 2>/dev/null; thenprint_info "Removing mp mounts for pulse-sensor-proxy to keep snapshots and migrations working"- sed -i '/^mp[0-9]\+: .*pulse-sensor-proxy/d' "$LXC_CONFIG"+ if [ -n "$SNAPSHOT_START" ]; then+ # Only modify main section (before snapshots)+ sed -i "1,$((SNAPSHOT_START-1)) { /^mp[0-9]\+: .*pulse-sensor-proxy/d }" "$TEMP_CONFIG"+ else+ sed -i '/^mp[0-9]\+: .*pulse-sensor-proxy/d' "$TEMP_CONFIG"+ fiMOUNT_UPDATED=truefi- if grep -q "^lxc.mount.entry: .*/pulse-sensor-proxy" "$LXC_CONFIG" 2>/dev/null; then- if ! grep -qxF "$LOCAL_MOUNT_ENTRY" "$LXC_CONFIG"; then+ if grep -q "^lxc.mount.entry: .*/pulse-sensor-proxy" "$TEMP_CONFIG" 2>/dev/null; then+ if ! grep -qxF "$LOCAL_MOUNT_ENTRY" "$TEMP_CONFIG"; thenprint_info "Updating existing lxc.mount.entry for pulse-sensor-proxy"- sed -i "s#^lxc.mount.entry: .*pulse-sensor-proxy.*#${LOCAL_MOUNT_ENTRY}#" "$LXC_CONFIG"+ if [ -n "$SNAPSHOT_START" ]; then+ sed -i "1,$((SNAPSHOT_START-1)) { s#^lxc.mount.entry: .*pulse-sensor-proxy.*#${LOCAL_MOUNT_ENTRY}# }" "$TEMP_CONFIG"+ else+ sed -i "s#^lxc.mount.entry: .*pulse-sensor-proxy.*#${LOCAL_MOUNT_ENTRY}#" "$TEMP_CONFIG"+ fiMOUNT_UPDATED=trueelseprint_info "Container already has migration-safe lxc.mount.entry for proxy"fielseprint_info "Adding lxc.mount.entry for pulse-sensor-proxy"- echo "$LOCAL_MOUNT_ENTRY" >> "$LXC_CONFIG"+ # Insert before snapshot section if it exists, otherwise append+ if [ -n "$SNAPSHOT_START" ]; then+ sed -i "${SNAPSHOT_START}i ${LOCAL_MOUNT_ENTRY}" "$TEMP_CONFIG"+ else+ echo "$LOCAL_MOUNT_ENTRY" >> "$TEMP_CONFIG"+ fiMOUNT_UPDATED=truefi+ # Copy back to trigger pmxcfs sync+ if [[ "$MOUNT_UPDATED" = true ]]; then+ cp "$TEMP_CONFIG" "$LXC_CONFIG"+ fi+ rm -f "$TEMP_CONFIG"+if ! pct config "$CTID" | grep -qxF "$LOCAL_MOUNT_ENTRY"; thenprint_error "Failed to persist migration-safe socket mount in container config"if [ -n "$LXC_CONFIG_BACKUP" ] && [ -f "$LXC_CONFIG_BACKUP" ]; then