Repository navigation
tailscale: keep tailscaled when a rejoin times out at boot - #5
Merged
Merged
Conversation
The service starts at boot, often before the Wi-Fi has associated, so `tailscale up` cannot reach the control server within its 15 seconds. ts-run then exited, its trap stopped tailscaled, and the service supervisor never started it again: the printer stayed off the tailnet until the service was restarted by hand. A printer that has joined before keeps its login in the state file and tailscaled connects on its own once the network is up, so ts-run now records a successful join and, on a later start, logs a failed join and keeps tracking tailscaled. A first join that fails still stops the service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Olav Gausaker <olav@gausaker.com>
unlucio
added a commit
that referenced
this pull request
Nov 10, 2026
tailscale: keep tailscaled when a rejoin times out at boot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
After a reboot, the Tailscale plugin could leave the printer off the tailnet for good.
ts-runstartstailscaled, then runstailscale up --timeout=15sunderset -e. At boot the Wi-Fi is often not associated yet, so the join times out, the script exits, its trap stopstailscaled, and the U1's service script never starts it again.This keeps
tailscaledrunning when that join fails on a printer that has joined before: it holds the saved login in its state file and connects on its own once the network is up. A first join that fails still stops the service, so a rejected key behaves as before.ts-runwrites$DATA_DIR/joinedafter atailscale upthat succeeds. On a later start, a failed join is logged instead of fatal when that marker exists.Fixes #4.
User story
As a printer owner who reaches the printer over Tailscale, I want it back on the tailnet after every reboot, even when the Wi-Fi is slow to connect, so that I do not have to restart the service by hand.
Checklist
bash scripts/check.sh, 11/11).tailscale/tests/run.sh(a printer that joined before starts with no network) fails ondevwith "ts-run exited on a failed join although this printer had joined before". Test 3 now also checks that a successful join writes the marker.Notes for the reviewer
tailscale0was up 25 seconds after boot. With 0.1.2, the reboot just before it left notailscale0five minutes after boot, with good Wi-Fi.tailscale upin a loop. I went with lettingtailscaledreconnect on its own, as it does on any Linux host, and kept the 15 second bound on the CLI. Happy to switch if you prefer.manifest.jsonis bumped to 0.1.3; renumber as you see fit.🤖 Generated with Claude Code