I have a service loaded via terminal as launchctl load /System/Library/LaunchAgent/com.example.my.plist
Now, I need to programmatically detect if the service is running or not and start the service. http://www.opensource.apple.com/source/launchd/launchd-328/launchd/src/launch.h Above is the link to launch.h api provided by Apple that helps to achieve this.
Can anyone help me with its documentation? or, help me how to use the api to check the status of a service and to launch the same.
Thanks.