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