title: Using OSX system keychain from a daemon
body: <p>I have a daemon that needs to run as root and is started by launchd.  This daemon needs to store some user supplied credentials so I have it writing them to the System keychain using SecKeychainOpen and similar functions.</p>
  
  <p>I'm pretty sure that since this runs as root I have to use the System keychain (since using a user's login keychain is not correct as this doesn't run as a normal user).</p>
  
  <p>My installer loads this into launchd using launchctl at the end of the install.  The problem is that it doesn't actually start until after a reboot.  I had OnLOad set as true in the plist, but it appears that when using the system keychain I need to the reboot for it to work.</p>
  
  <p>I was wondering if anyone knows of some way to deal with this since it would be a much better user experience if a reboot was not necessary.  So to be clear, can I programatically access the System keychain from a daemon using launchd without a reboot?</p>
  
  <p>Thanks for any advice or ideas.</p>