← Back to Pull requests

tailscale: don't clean up a running daemon on upgrade #30728

Open
unknown opened this pull request with 420 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 08, 2026 12:50 UTC
Author

📦 Package Details

Maintainer: @SuperSandro2000

Description:

tailscale loses connectivity after a package upgrade. On upgrade, default_postinst runs /etc/init.d/tailscale start while tailscaled is already running. start_service() always runs tailscaled --cleanup first, and that cleans up the running daemon's state:

cleanup: delete and flush chain ts-input
cleanup: delete and flush chain ts-forward
cleanup: delete and flush chain ts-postrouting
router: removed 2 stale Tailscale address(es) from tailscale0 during cleanup: [100.x.x.x/32 fd7a:115c:a1e0::xxxx/128]

procd then sees unchanged instance data and does not restart the instance. The old daemon keeps running without its ts- chains and, since 1.102.0, without its tailscale0 addresses (tailscale/tailscale@77d2c87). The node still shows as online in the admin console, but it and any advertised subnets are unreachable until /etc/init.d/tailscale restart or a reboot.

The maintainers of the GuNanOvO/openwrt-tailscale feed use this init script verbatim. They reproduced the issue with this package as well (GuNanOvO/openwrt-tailscale#170):

| Environment | Package | daemon restarted | tailscale0 address | ts- nft rules |
|---|---|---|---|---|
| OpenWrt 24.10 | official (1.80.3) | no | kept¹ | 12 → 0 |
| OpenWrt 25.12 | official (1.98.3) | no | kept¹ | 12 → 0 |
| OpenWrt 25.12 | official (1.102.3, current master) | no | removed | 12 → 0 |

¹ Builds ≤ 1.100.x only flush the nft chains during --cleanup. Reachability breaks either way.

The changes:

  • start_service() skips --cleanup when the service is already running. A cold start still cleans up leftovers from an unclean shutdown.

  • procd_set_param file /usr/sbin/tailscaled makes procd restart the instance when the binary changes, so an upgrade actually runs the new daemon.

  • Cleanup moves from stop_service() to service_stopped(), so it runs after procd has stopped the daemon instead of while it is still running.
  • PKG_RELEASE is bumped.

    ---

    🧪 Run Testing Details

  • OpenWrt Version: 25.12.5 (r33051-f5dae5ece4)

  • OpenWrt Target/Subtarget: ramips/mt7621

  • OpenWrt Device: Linksys EA7500 v2
  • I tested the patched init script with tailscale 1.104.1, built from the GuNanOvO feed with an identical init script, on a subnet router using fw_mode nftables:

  • start while the daemon is running and nothing has changed: same PID; the address and ts- chains are kept.

  • start with changed procd instance data, as after an upgrade: procd restarts the daemon, --cleanup doesn't touch the live daemon, and the new daemon comes up with its addresses, 6 ts- chains and working subnet routing.

  • restart: cleanup runs after the daemon has exited, and everything comes back.

  • With a throwaway procd service, procd_set_param file doesn't restart the instance on an unchanged start, but does once the file's contents change.
  • I haven't built or tested this exact package from this tree.

    ---

    ✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.
  • 🤖 Generated with Claude Code

    Diff: 420 lines (+315 / -105) across 5 files Reviewer: SuperSandro2000 Review duration: 8044m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 420 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.362
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #30728"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45% (MEDIUM) · Higher = larger blast radius
    45%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.0% · Safe to merge
    24.0%