When you have a launchd daemon that can be triggered by XPC messages, it could be possible to check whether the daemon is doing something using XPCs.
The issue is that this would start the daemon.
Question:
Is there a "launchd" way to know whether a daemon is running? That does not involve starting the daemon.
By "launchd" way, I mean a solution which is not basically checking the entire list of running processes and figuring out whethere the daemon is there somewhere.
Already quickly checked:
- SystemManagement APIs: they are considered obsolete and do not allow this as far as I can tell.
- launch.h: it's considered obsolete and is not well documented and does not look like to allow this.
Maybe it's possible to achieve this via the NSXPC APIs but I have not found an obvious solution yet.