Update postinstall to use more modern launchctl commands (#4179)
* Update postinstall to use more modern launchctl comamnds Fixes #3995 * Switching to service-target specifier * Removing unnecessary kill flag
This commit is contained in:
@@ -0,0 +1 @@
|
||||
* Update macOS package postinstall script to use more modern `launchctl` commands.
|
||||
@@ -37,8 +37,17 @@ ln -sf /var/lib/orbit/bin/orbit/macos/{{.OrbitChannel}}/orbit /var/lib/orbit/bin
|
||||
ln -sf /var/lib/orbit/bin/orbit/orbit /usr/local/bin/orbit
|
||||
|
||||
{{ if .StartService -}}
|
||||
launchctl unload /Library/LaunchDaemons/com.fleetdm.orbit.plist
|
||||
launchctl load -w /Library/LaunchDaemons/com.fleetdm.orbit.plist
|
||||
DAEMON_LABEL="com.fleetdm.orbit"
|
||||
DAEMON_PLIST="/Library/LaunchDaemons/${DAEMON_LABEL}.plist"
|
||||
|
||||
# Remove any pre-existing version of the config
|
||||
launchctl bootout "system/${DAEMON_LABEL}"
|
||||
# Add the daemon to the launchd system
|
||||
launchctl bootstrap system "${DAEMON_PLIST}"
|
||||
# Enable the daemon
|
||||
launchctl enable "system/${DAEMON_LABEL}"
|
||||
# Force the daemon to start
|
||||
launchctl kickstart "system/${DAEMON_LABEL}"
|
||||
{{- end }}
|
||||
`))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user