fix(uninstall): don't abort POSIX uninstaller when sudo fails on apt/dnf removal - #230
Open
emohack wants to merge 1 commit into
Open
fix(uninstall): don't abort POSIX uninstaller when sudo fails on apt/dnf removal#230emohack wants to merge 1 commit into
emohack wants to merge 1 commit into
Conversation
…dnf removal The rest of remove_runtime_linux() wraps every step in `|| true` (systemctl stop/disable/daemon-reload, monk machine stop, brew uninstall), but the package removals are not. With set -eu, a failing `sudo apt-get remove` / `sudo dnf remove` (no sudo installed, or non-interactive without passwordless sudo) aborts the script after the agent files were already removed — user sees a non-zero exit and no completion message while the Monk runtime is left half-removed. Match the surrounding guards with `|| true`.
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.
Context
In
remove_runtime_linux()every step is wrapped in|| true(systemctl stop/disable/daemon-reload,monk machine stop,brew uninstall), but the two package removals are not:sudo apt-get remove -y monksudo dnf remove -y monkThe script runs with
set -eu(line 2). Whensudois unavailable (minimal/root container) or non-interactive without passwordless sudo, the failingsudoaborts the whole script after the agent files were already removed, so the user gets a non-zero exit and no "uninstall complete." message while the Monk runtime is left half-removed.Change
Wrap both package removals in
|| true, matching the surrounding guards.Verification
sh -npasses; diff is 2 lines.