Skip to content

fix(vpn): pia-consent daemon + vpn-monitor crash-loop fix#75

Merged
smartwatermelon merged 1 commit intomainfrom
claude/fix-vpn-monitor-pia-consent-1772214026
Feb 27, 2026
Merged

fix(vpn): pia-consent daemon + vpn-monitor crash-loop fix#75
smartwatermelon merged 1 commit intomainfrom
claude/fix-vpn-monitor-pia-consent-1772214026

Conversation

@smartwatermelon
Copy link
Copy Markdown
Owner

Summary

  • pia-proxy-consent: Convert from StartInterval=60 single-pass job to a KeepAlive daemon with a 10s polling loop. The old design caused launchd ThrottleInterval escalation: consistent 3-second exits (checking 3 candidate processes serially) caused launchd to back off well beyond 60s, resulting in multi-hour gaps — confirmed by user observation of 90+ minute window where consent dialog went unclicked.
  • vpn-monitor: Three || log "WARNING" additions on all launch_transmission calls prevent set -e from crashing the monitor when Transmission takes longer than 6s to start. Previously, this triggered KeepAlive restart storms (Feb 16 log shows 10s restart cycles for 15+ minutes) that prevented Transmission from ever stabilizing, sometimes leaving it bound to the wrong IP.
  • vpn-monitor health check: New block in main polling loop: if VPN is up but Transmission is not running (crash mid-session or failed initial launch), automatically relaunch with last-known VPN IP.
  • transmission-setup.sh: Update pia-proxy-consent plist from StartInterval to KeepAlive to match new daemon pattern, add StandardOutPath/StandardErrorPath for better log capture.

Root Causes Fixed

Symptom Root Cause
PIA consent dialog ignored for 90+ min StartInterval job exits in ~3s → launchd throttle escalates past 90min
Transmission on wrong IP after VPN restart launch_transmission failure → set -e exits monitor → KeepAlive restarts → kill/restart storm
No recovery from mid-session Transmission crash Health check was absent

Deployed & Verified on Tilsit

Both scripts deployed and running on the live server:

  • com.tilsit.vpn-monitor: running, Transmission at PID 87984 on VPN IP
  • com.tilsit.pia-proxy-consent: running in daemon mode, 10s poll loop active

Test Plan

  • Reboot tilsit and confirm PIA consent dialog is clicked within 10s of appearing
  • Confirm Transmission binds to VPN IP after boot (check BindAddressIPv4 pref)
  • Force-quit Transmission manually; confirm vpn-monitor relaunches it within ~5s
  • Disconnect VPN briefly; confirm Transmission is killed then relaunched on reconnect

🤖 Generated with Claude Code

pia-proxy-consent: Convert StartInterval single-pass job to KeepAlive
daemon with a 10s polling loop. The previous StartInterval=60 design
caused launchd ThrottleInterval escalation: consistent 3-second exits
(script checks 3 processes + fallback serially) caused launchd to back
off well beyond 60s, causing multi-hour gaps in monitoring — which is
exactly what was observed (dialog visible for 90+ minutes).

vpn-monitor: Three targeted || log "WARNING" additions on all
launch_transmission calls prevent set -e from crashing the monitor when
Transmission fails to start within 6s. Previously this triggered
KeepAlive restart storms (visible Feb 16 log: 10s restart loop for
15+ minutes) that prevented Transmission from ever stabilizing.

Added health check in the main polling loop: if VPN is up but
Transmission is not running (crashed mid-session or failed initial
launch), automatically relaunch with the last-known VPN IP.

transmission-setup.sh: Update pia-proxy-consent plist from
StartInterval to KeepAlive to match new daemon pattern.

Issues fixed:
- PIA consent dialog ignored for 90+ minutes (launchd throttle)
- Transmission bound to wrong IP after VPN restart storm (crash-loop)
- No recovery if Transmission crashes mid-session

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@smartwatermelon smartwatermelon merged commit 7b35b56 into main Feb 27, 2026
17 checks passed
@smartwatermelon smartwatermelon deleted the claude/fix-vpn-monitor-pia-consent-1772214026 branch February 27, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant