Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cask/artifact/abstract_uninstall: handle signal failures. #16372

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion Library/Homebrew/cask/artifact/abstract_uninstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,13 @@
# misapplied "kill" by root could bring down the system. The fact that we
# learned the pid from AppleScript is already some degree of protection,
# though indirect.
# TODO: check the user that owns the PID and don't try to kill those from other users.
odebug "Unix ids are #{pids.inspect} for processes with bundle identifier #{bundle_id}"
Process.kill(signal, *pids)
begin
Process.kill(signal, *pids)
rescue Errno::EPERM => e
opoo "Failed to kill #{bundle_id} PIDs #{pids.join(", ")} with signal #{signal}: #{e}"

Check warning on line 287 in Library/Homebrew/cask/artifact/abstract_uninstall.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cask/artifact/abstract_uninstall.rb#L287

Added line #L287 was not covered by tests
end
sleep 3
end
end
Expand Down