Repository navigation
Conversation
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.
Summary
Related to #1774.
Fix credential cleanup during Linux service installation when the installation fails after creating a service definition.
Previously, cloudflared service install could fail during systemd startup and remove /etc/cloudflared/token, even though the service remained installed and enabled. Subsequent service restarts would then fail because the token file was missing.
Changes
Testing
Validated on Linux ARM64 using Go 1.27.3:
Added six test functions covering 29 cases, including startup failures, partial service installations, existing credentials, symlinks, file permissions, and SysV/OpenRC service definitions.
The complete test suite is not fully green. An unrelated TLS curve test also fails on unchanged HEAD, and intermittent network test failures were observed. No actual systemd service startup was performed.
Scope
This fixes the credential-loss consequence of #1774, but does not address the original systemd startup timeout. The existing Type=notify and TimeoutStartSec=15 settings remain unchanged.