Modernize macOS uninstaller: fix service management and add force mode #2423
+773
−25
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
This PR modernizes the macOS uninstaller to fix critical issues reported in #2347 and implements all recommendations from @natoscott.
Problem
The current
uninstall-pcpscript has several critical issues:/Library/StartupItemswhich hasn't existed on macOS for yearspkgutil/tmppathsChanges
This PR addresses all issues through 4 logical commits:
Commit 1: Fix pmproxy plist typo
Commit 2: Modernize service management
/Library/StartupItemswith modernlaunchctlcommandsbootout(macOS 10.11+) andunloadfor compatibilitypkgutil --forgetfor modern package receipt managementCommit 3: Add force mode and mktemp
mktemp(1)for secure temp directory creation-f/--forceflag to skip confirmation and perform complete removal--helpflag for usage information/etc/pcp//var/lib/pcp//var/log/pcp/Commit 4: Documentation
HOMEBREW_TAP_UPDATES.mdwith recommendations for aligning Homebrew tapTESTING_GUIDE.mdwith comprehensive testing proceduresTesting
Standard uninstall preserves config/logs:
Force mode removes everything:
See
build/mac/TESTING_GUIDE.mdfor comprehensive testing procedures.Impact
Notes
This PR is marked as DRAFT for manual testing on macOS VMs before final review.
Fixes #2347