Bring the bypass up after a reboot #169
Loading…
Reference in a new issue
No description provided.
Delete branch "bypass-reboot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
After a machine reboot, nothing rebuilds the bypass:
reconcile_bypassneeds a leftover cgroup (a fresh boot has none),service_recoveredonly fires when the service restarts under a running gui, and plain gui startup never calledbypass(). Confirmed live: zero rebuilds for 40 hours after the Aug 25 reboot, with the configured bypass network (gluetun) double-tunneling its full seeding load through the OpenVPN connection — the mechanism behind the post-reboot share of #118's tunnel UDP-loss windows, felt as Discord dropping in and out.Fix
Split along what each side can know:
create_cgroupintobypass.set_routing(behavior unchanged for the cgroup path — it calls the same function).reconcile_bypassnow applies routing +set_network_ruleseven when there is no cgroup to restore, gated onbypass=1and an existing default route — so it lands at boot once the network is up, and re-asserts on every network-up via the existingnetwork_changed→ reconcile path. Forwarded-traffic exemptions need no cgroup owner and no longer wait for one.bypass()is called at gui startup (after config load), not only inservice_recovered; andservice_recoveredfires an idempotent delayed second call, covering the observed case of the first call being refused while a fresh service was still settling on the bus (the Aug 24 18:22 polkit refusal had no retry).Verification
pytestgreen (373 passed) plus the ruff/compileall gates.service_recoveredfires the rebuild twice and skips it when bypass is disabled.sudo iptables-legacy -t mangle -S | grep 51820should show theaqomui_bypass_netrule with no manual settings-apply, and the 30-packet capture should show gluetun's WireGuard staying onenp5s0with the tunnel up.Closes #168
🤖 Generated with Claude Code