fix(auto-updates): use LaunchDaemon for brew, native macOS for MAS#62
Merged
smartwatermelon merged 2 commits intomainfrom Feb 13, 2026
Merged
Conversation
LaunchAgents under the administrator account never fire because that user is rarely logged in on the desktop GUI. Convert to LaunchDaemons (which run regardless of GUI session) with UserName key to drop privileges to the administrator user. Changes: - Homebrew: LaunchAgent -> LaunchDaemon with UserName key - MAS: Replace mas LaunchAgent with native macOS auto-update (defaults write com.apple.commerce AutoUpdate) - Add cleanup function to remove old LaunchAgents from prior deployment - Fix --force to bypass "already configured" early return - Update docs/vpn-transmission.md Stage 5 table Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
If run with sudo, whoami returns "root", misconfiguring the LaunchDaemon UserName and LOG_DIR. Add EUID check matching the pattern in setup-remote-desktop.sh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
UserNamekey — LaunchAgents never fire because the administrator is rarely logged in on the desktop GUImasLaunchAgent with native macOS auto-update (defaults write com.apple.commerce AutoUpdate)--forcenow bypasses "already configured" early returndocs/vpn-transmission.mdStage 5 tableContext
LaunchAgents only run when the user has an active GUI session. The administrator account on the Mac Mini is almost never logged in on the desktop (the
operatoruser has the persistent GUI session via auto-login). This means all LaunchAgents under the administrator account never execute.LaunchDaemons run regardless of GUI session state. The
UserNameplist key causes launchd to drop privileges from root to the specified user before executing the program, so the brew upgrade runs as the administrator (who owns Homebrew) without running as root.For Mac App Store,
mas upgradealso requires a GUI session context, so we use the native macOS auto-update mechanism instead (com.apple.commerce AutoUpdate).Test plan
setup-auto-updates.sh --forceon target serversudo launchctl list | grep brew-upgrade~/Library/LaunchAgents/defaults read /Library/Preferences/com.apple.commerce AutoUpdatesudo launchctl list | grep softwareupdatecat ~/.local/state/tilsit-brew-upgrade.log🤖 Generated with Claude Code