mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
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:
parent
ed41c2a445
commit
bb0b56acb7
2 changed files with 12 additions and 2 deletions
1
changes/issue-3995-update-postinstall-launchdaemon
Normal file
1
changes/issue-3995-update-postinstall-launchdaemon
Normal file
|
|
@ -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 }}
|
||||
`))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue