Tuesday, 15 June 2010

OSX: which type of Daemon/Background Process should I use? -


I have a program that I want to wake up from sleep and wake up from sleep. However, I found a resource on different types of services that could have been used for me. Which type of daemon / background service is the best suit for my purposes but a good answer is required here. There is a framework:

1) It will launch automatically in the background (alias without making the user aware about it) when the computer either swells Resume, or resume with shut down state

2) The program will work separately for each user. Files created as a result of the operation of the program must be different for each user.

I have received a good resource but I am unsure of using it: log in items, XPC service, launch daemon, or launch agent.

2) The program will work separately for each user. Files created as a result of the operation of the program will need to be separate for each user.

This strongly suggests to use the launcher, because they are per-users (and users).

The page you might want is the man page.

I do not know about your launch trigger, which matches your request, which can unfortunately mean that you have KeepAlive for options and power changes Monitor.

You can launch (though not bootable, since it has not been launched by you), so it's easy. Sleep and PowerDown can be easily managed by looking at information like coco and NSWorkspace via NSWorkspaceWillPowerOffNotification and NSWorkspaceWillSleepNotification . If cocoa is a very high level for your problem, then you can stop IOKit power management events. See IOKit Fundamentals for a good low-level introduction.

Note that there is a "type of awake but not really" state called DarkWalk, which can confuse you based on your needs. 2012 WWDC Video On This is a good introduction to the problem.


No comments:

Post a Comment