kardianos / service

Run go programs as a service on major platforms.
zlib License
4.44k stars 677 forks source link

Goal: Improve macOS (darwin) launchctl commands #349

Open n8felton opened 2 years ago

n8felton commented 2 years ago

The goal of this issue is to replace some of the older, legacy, launchctl commands with more modern ones. See https://github.com/fleetdm/fleet/issues/3995 for examples.

The most notable change to deal with is replacing the output of launchctl list with launchctl print https://github.com/kardianos/service/blob/3596dfaf340d19b3f4d3c1029517a623367f65d5/service_darwin.go#L217

To make things more fun and interesting, man launchctl specifically calls out

IMPORTANT: This output is NOT API in any sense at all. Do NOT rely on the structure or information emitted for ANY reason. It may change from release to release without warning.

To make things even more fun, Apple is is deprecating the current form of LaunchAgents and LaunchDaemons, so we'll need to keep an eye on that...

https://developer.apple.com/documentation/servicemanagement/updating_helper_executables_from_earlier_versions_of_macos

CC: #322

prochac commented 1 year ago

Is replacement of something that works, by something that can break, even a step forward?