thanks for the breakdown gan, but unfortunately those approaches won't work for me here.

Yes I am running a script to set up a new user. the new user currently logged in actually. (this user will then be exported to the new user template) Nothing else is being set by any other app, the script is expected do as much of the setup as physically possible, including installing software and verifying software is present and version numbers are correct. So killing the daemon harms nothing.

Building the plist isn't an option, there are somewhere around 100 things getting changed in the plists. (and at least half that many things being set by other means like dsconfigad) I'm not going to edit 100 plists by hand. That approach would get much uglier if I wanted to make several different changes in the same plist. it would be too easy to overwrite a change by trying to add another later.

Sending entire trees into defaults is a nightmare. it becomes a nightmare within a nightmare when you are dealing with nested trees, such as changing default search paths on all the network adapters. NOT going there. Not more than once anyway. I have surrendered to that technique in exactly one place due to lack of options. Such changes are very difficult to verify, and my script vigorously verifies things, and only changes what needs to be changed. It can be ran over and over, and often needs to be run several times as I address all the things its pointing out I need to do (installs and updates mostly) which I will do a few at a time.

I spent several days looking for ways to "play nicely" with cfprefsd, but the bottom line was it doesn't want to play nice. Two Apple engineers backed me up on this opinion.


I work for the Department of Redundancy Department