From 975c4ee42c1529673a51382c62c4096dc663f80a Mon Sep 17 00:00:00 2001 From: Kevin Li Date: Thu, 1 Jun 2023 14:49:30 -0700 Subject: [PATCH] fix: Stop lima process in postinstall and uninstall (#438) *Description of changes:* Unstopped lima process can prevent new installation and finch vm init successfully. Add kill limactl to post-installation and uninstall script to fix the issue. *Testing done:* Tested locally. - [X] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: Kevin Li --- installer-builder/darwin/Resources/uninstall.sh | 7 ++++--- installer-builder/darwin/scripts/postinstall | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/installer-builder/darwin/Resources/uninstall.sh b/installer-builder/darwin/Resources/uninstall.sh index f19d9d9c0..44466b585 100755 --- a/installer-builder/darwin/Resources/uninstall.sh +++ b/installer-builder/darwin/Resources/uninstall.sh @@ -15,6 +15,10 @@ while true; do done echo "Application uninstalling process started" +sudo pkill '^socket_vmnet' +sudo pkill '^qemu-system-' +sudo pkill '^limactl' + if [ "$$(readlink "/usr/local/bin/finch")" = "/Applications/Finch/bin/finch" ]; then sudo rm /usr/local/bin/finch; fi echo "[1/3] [DONE] Successfully deleted shortcut links" @@ -37,8 +41,5 @@ else echo "[3/3] [ERROR] Could not delete application" >&2 fi -sudo pkill '^socket_vmnet' -sudo pkill '^qemu-system-' - echo "Application uninstall process finished" exit 0 diff --git a/installer-builder/darwin/scripts/postinstall b/installer-builder/darwin/scripts/postinstall index 791091a13..de4dbd7df 100755 --- a/installer-builder/darwin/scripts/postinstall +++ b/installer-builder/darwin/scripts/postinstall @@ -2,6 +2,10 @@ echo "Post installation process started..." +sudo pkill '^socket_vmnet' +sudo pkill '^qemu-system-' +sudo pkill '^limactl' + #change permissions in home directory echo "Change permissions for product home directory." cd /Applications/Finch @@ -11,8 +15,6 @@ chmod -R 755 /Applications/Finch/dependencies/lima-socket_vmnet/opt/finch #clean old artifacts sudo ln -sf /Applications/Finch/bin/finch /usr/local/bin/finch -sudo pkill '^socket_vmnet' -sudo pkill '^qemu-system-' sudo rm -rf "/Applications/Finch/lima/data/finch/" sudo rm -rf "/Applications/Finch/lima/data/_config/override.yaml" sudo rm -rf "/Applications/Finch/lima/data/_config/user"