Have a LaunchAgent sleep when the computer sleeps
I'm creating a daemon that will be installed in the LaunchAgents folder. Some questions about making it sleep:
- Because it's a LaunchAgent item will the executable automatically sleep when the user/system sleeps?
- If the answer is yes to question 1, do I need to specify anything in the plist document?
- If the 开发者_开发问答answer is no to question 1, what is the best approach to deal with this problem?
Basically my app needs to sleep when the computer sleeps. What is the best way to make this happen in C or Cocoa?
Thanks!
You may find good answers on this question:
What happens to my app when my Mac goes to sleep?
Basically, the execution of your app will be freezed when the computer goes into sleep mode. It's automatically resumed when the computer wakes-up...
精彩评论