On Jun 14, 2010, at 12:09 PM, Nick Zitzmann wrote:

> Use launchd's launch daemons feature.

There’s an Apple tech note on daemons and agents — required reading if you want 
to get into this. Search for it in the Xcode doc viewer.

The difference between the two is that a daemon is per-machine while an agent 
is per-user. A daemon starts at boot time and persists across user logins (or 
when no user is logged in); an agent starts when a user logs in and quits when 
the user logs out (and there can be multiple agents running at once if several 
users are logged in.)

Agents are safer because they run as a normal user. Daemons often run as root, 
so a security bug in a networked daemon could cause the whole machine to get 
pwned. One workaround is to create a new user account just to run your daemon 
and configure its launchd plist to run as that user. Many of the system daemons 
like Apache do that.

—Jens_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to