From b56d2e452e0b4d2fa27b015ddd148820b047e738 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Tue, 2 Aug 2022 17:03:14 -0400 Subject: [PATCH] Stop the previous desktop agent when updating on macOS. Fixes #6441 (#7015) --- changes/issue-6441-kill-old-desktop-when-installing | 1 + orbit/pkg/packaging/macos_templates.go | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 changes/issue-6441-kill-old-desktop-when-installing diff --git a/changes/issue-6441-kill-old-desktop-when-installing b/changes/issue-6441-kill-old-desktop-when-installing new file mode 100644 index 0000000000..e5a5e5eeb3 --- /dev/null +++ b/changes/issue-6441-kill-old-desktop-when-installing @@ -0,0 +1 @@ +* Stop the old version of Fleet desktop before starting a new version. diff --git a/orbit/pkg/packaging/macos_templates.go b/orbit/pkg/packaging/macos_templates.go index 8d219d6770..a8d64644c3 100644 --- a/orbit/pkg/packaging/macos_templates.go +++ b/orbit/pkg/packaging/macos_templates.go @@ -55,6 +55,8 @@ ln -sf /opt/orbit /var/lib/orbit DAEMON_LABEL="com.fleetdm.orbit" DAEMON_PLIST="/Library/LaunchDaemons/${DAEMON_LABEL}.plist" +# Stop the previous desktop agent +pkill fleet-desktop || true # Remove any pre-existing version of the config launchctl bootout "system/${DAEMON_LABEL}" # Add the daemon to the launchd system