• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Launch Daemon Best Practices?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch Daemon Best Practices?


  • Subject: Re: Launch Daemon Best Practices?
  • From: Chris Suter <email@hidden>
  • Date: Wed, 12 Mar 2008 11:18:08 +1100


On 12/03/2008, at 10:16 AM, Karl Moskowski wrote:

Why not do it the other way round? Update settings via distributed
objects, and have the daemon write them to /Library/Preferences.

Good idea. Thanks, Hamish.

I'm not so sure it's a good idea. The problem is that it relies on your daemon running which whilst might be true most of the time, it might not be—if it's restarting for example. I personally would write the defaults from the GUI application.


Do processes run by launchd automatically write their preference plists to /Library/Preferences/ using NSUserDefaults?

No I don't think they will. If you're running as root, preferences will get written to /var/root/Library/Preferences which is not what you want.


To write to /Library/Preferences I think you'll need to use CFPreferencesSetValue.

If you can get away with it you could just periodically check to see if the defaults have changed. A Cocoa application will periodically synchronise the defaults but you'll still have to check to see if anything has changed. If that doesn't work for you, you can use distributed objects as you've suggested or you can use any of the other IPC mechanisms available to you.

- Chris

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Launch Daemon Best Practices?
      • From: Karl Moskowski <email@hidden>
    • Re: Launch Daemon Best Practices?
      • From: "Hamish Allan" <email@hidden>
References: 
 >Launch Daemon Best Practices? (From: Karl Moskowski <email@hidden>)
 >Re: Launch Daemon Best Practices? (From: "Hamish Allan" <email@hidden>)
 >Re: Launch Daemon Best Practices? (From: Karl Moskowski <email@hidden>)

  • Prev by Date: Re: NSTask and process group IDs
  • Next by Date: Re: Launch Daemon Best Practices?
  • Previous by thread: Re: Launch Daemon Best Practices?
  • Next by thread: Re: Launch Daemon Best Practices?
  • Index(es):
    • Date
    • Thread