I’m wondering if there is some way to inspect a running agent to determine if it is currently executing a job? My use case is that we run a fleet of macs, and to perform rolling updates I offline the agents until the updates are complete.
The mechanism I currently use to offline the agents is to
launchctl unload <launch-agent-plist> which in turn sends a SIGTERM to the agent, but that is non-blocking, and so I still don’t know when the agent has finished up gracefully.
I might be missing something obvious.