Skip to content

fix(boot-start): use LaunchDaemon on MacOS#423

Merged
jdx merged 3 commits into
jdx:mainfrom
gaojunran:fix-boot-start-daemon
May 5, 2026
Merged

fix(boot-start): use LaunchDaemon on MacOS#423
jdx merged 3 commits into
jdx:mainfrom
gaojunran:fix-boot-start-daemon

Conversation

@gaojunran

@gaojunran gaojunran commented May 5, 2026

Copy link
Copy Markdown
Contributor

fixes #422.

@greptile-apps

greptile-apps Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

  • Bumps auto-launcher to 1.0.3 and switches the root-level macOS boot entry from LaunchAgentSystem (/Library/LaunchAgents/) to LaunchDaemonSystem (/Library/LaunchDaemons/), adding a legacy field plus cleanup_legacy() to migrate and clean up pre-1.0.3 installations. The migration order (write new entry first, then remove legacy) is correct.
  • BootDisable::run() now performs a post-disable is_enabled() check so non-root users with an inaccessible legacy entry receive an actionable error instead of a false success message.
  • BootStatus::run() gains a (false, false) if is_enabled() guard to surface a legacy-only entry rather than printing "Boot start is disabled", but the arm uses the same generic "Boot start is enabled" message as the fully-migrated case, giving root users who have not yet re-run sudo pitchfork boot enable no indication that their entry is still a LaunchAgent and needs migration.

Confidence Score: 4/5

Safe to merge; all previously identified P1 issues are addressed. Remaining findings are P2 (status UX and a misleading doc comment).

No P0 or P1 issues remain. The two P2 findings are a status message that omits migration guidance for root users upgrading from pre-1.0.3, and an overstated doc comment on disable(). Neither affects correctness or data integrity.

src/cli/boot.rs line 160 (legacy-only status arm) and src/boot_manager.rs lines 201–206 (disable doc comment)

Important Files Changed

Filename Overview
src/boot_manager.rs Core logic change: adds legacy (LaunchAgentSystem) field for migration/cleanup from pre-1.0.3; enable() now migrates after writing the new entry, disable() guards legacy removal on is_root(). Migration sequencing is correct. One minor status-reporting gap remains for root users with a legacy-only entry.
src/cli/boot.rs Adds post-disable is_enabled() check to catch incomplete cleanup, updates status to handle the legacy-only case via a match guard, and calls cleanup_legacy on the already-enabled early-return path.
Cargo.toml Bumps auto-launcher to 1.0.3 to pick up LaunchDaemonSystem support and plist dependency.
docs/cli/boot.md Documentation updated to reflect /Library/LaunchDaemons/ for root-level macOS entries.

Reviews (15): Last reviewed commit: "[autofix.ci] apply automated fixes (atte..." | Re-trigger Greptile

@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch from 2c7fbfe to 59700d0 Compare May 5, 2026 09:11
Comment thread src/boot_manager.rs
Comment thread src/boot_manager.rs Outdated
@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch from ea7711e to 45fb621 Compare May 5, 2026 09:19
Comment thread src/boot_manager.rs Outdated
@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch from d127ad4 to 3f357cd Compare May 5, 2026 09:25
Comment thread src/boot_manager.rs Outdated
@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch 2 times, most recently from 1aa7b72 to 56d2e00 Compare May 5, 2026 10:06
Comment thread src/boot_manager.rs
@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch from 57ae94b to fc4c716 Compare May 5, 2026 10:34
Comment thread src/boot_manager.rs Outdated
@gaojunran gaojunran marked this pull request as draft May 5, 2026 10:54
@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch 5 times, most recently from 3a751ce to 25c31a7 Compare May 5, 2026 11:54
@gaojunran gaojunran force-pushed the fix-boot-start-daemon branch from 7ca1e7d to a75018c Compare May 5, 2026 12:07
@gaojunran gaojunran closed this May 5, 2026
@gaojunran gaojunran reopened this May 5, 2026
@gaojunran gaojunran marked this pull request as ready for review May 5, 2026 12:23
@jdx jdx merged commit 1585e47 into jdx:main May 5, 2026
7 of 9 checks passed
jdx pushed a commit that referenced this pull request May 5, 2026
## 🤖 New release

* `pitchfork-cli`: 2.9.1 -> 2.10.0

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[2.10.0](v2.9.1...v2.10.0)
- 2026-05-05

### Added

- refine startup / tailing logs display
([#420](#420))
- *(proxy)* sync slug hosts
([#418](#418))
- inject daemon running info to tera template
([#419](#419))

### Fixed

- *(boot-start)* use LaunchDaemon on MacOS
([#423](#423))

### Other

- *(build)* use serious profile to eliminate binary size
([#424](#424))
- set dev profile debug to 1
([#415](#415))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
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.

2 participants