If you’ve implemented Local MCX on your Leopard and/or Snow Leopard machines, you’ll be wondering if it works on Lion, too.
Some earlier posts on Local MCX:
- https://managingosx.wordpress.com/2010/03/12/yet-again-with-the-local-mcx/
- https://managingosx.wordpress.com/2010/03/07/local-mcx-update/
- https://managingosx.wordpress.com/2010/03/07/mcx-in-non-default-local-nodes/
- https://managingosx.wordpress.com/2008/02/07/mcx-dslocal-and-leopard/
The answer is yes – Local MCX works in Lion. There is one minor issue, though: if you are putting your local MCX version in an alternate local directory node (like /Local/MCX), you’ll need to know that Lion is a bit pickier about the contents of the directories of alternate local nodes.
If opendirectoryd on Lion doesn’t like your MCX node, it might look something like this:
> dscl /Local/MCX list /
Data source (/Local/MCX) is not valid.
It turns out this is pretty easy to remedy: Lion’s opendirectoryd requires that a local directory node have at the minimum a “users” and a “groups” subdirectory. So if either of these subdirectories are missing, simply create them and restart opendirectoryd (killall opendirectoryd). dscl should now recognize the node:
> mkdir -p /private/db/dslocal/nodes/MCX/users
> mkdir -p /private/db/dslocal/nodes/MCX/groups
> killall opendirectoryd
> dscl /Local/MCX list /
AFPUserAliases
Aliases
Automount
AutomountMap
ComputerGroups
ComputerLists
Computers
Config
Ethernets
Groups
Hosts
Mounts
NetGroups
Networks
People
PresetComputerGroups
PresetComputerLists
PresetComputers
PresetGroups
PresetUsers
Protocols
RPC
Services
SharePoints
Users
Shouldn’t it be
mkdir -p /var/db/dslocal/nodes/MCX/users
mkdir -p /var/db/dslocal/nodes/MCX/groups
instead of /private/db/…
Crap.
We’re both wrong. It should be
/private/var/db
Though just /var/db will work.
I also discovered that I needed to modify my custom search list as /BSD/local isn’t included (at least from what I can see) in 10.7. I updated it thusly:
sudo dscl /Search -create / SearchPolicy CSPSearchPath
sudo dscl /Search -create / CSPSearchPath /Local/Default /Local/MCX
Without updating it, dscl threw an -14008 (eDSNodeNotFound) error and MCX settings would not apply as /Local/MCX was never added to the search path.
I had to do something similar for Lion as well. Thanks for mentioning it!
[…] preferences will perform just the same with this new/additional delivery method. I have used localMCX in Lion for Office2011 prefs without issue, and tested other Apple manually applying profiles with […]
I have been using this technique for a while on 10.6 without issue. However, I recently started to migrate my settings to 10.7 and noticed the MCXCCacheGraph error was back in the log, even when I am using /Local/MCX for my settings. Any ideas?
I don’t see MCXCCacheGraph errors on my Lion machines. Are you sure you don’t have a local computer object in /private/var/db/dslocal/nodes/Default/computers/ ?
I think something was being cached somewhere, as I did not get the error when I tried it again on another system. When I renamed my ‘dslocal’ computer object to something new, the error continued to refer to the old object name. Thanks.
Any tips on deploying the /Library/Preferences/OpenDirectory/Configurations/Search.plist file to other 10.7 systems? It seems to contain a UUID, so I may need to switch to scripting it instead of just packing the files like I did in 10.6. Thanks again.
Anonymous: I have always scripted this for both 10.6 and 10.7. Here is the part of my script that modifies the search list in 10.7:
sudo /usr/bin/dscl /Search -create / SearchPolicy CSPSearchPath
sudo /usr/bin/dscl /Search -create / CSPSearchPath /Local/Default /Local/MCX
Compare that with 10.6, which also includes /BSD/local:
sudo /usr/bin/dscl /Search -create / SearchPolicy CSPSearchPath
sudo /usr/bin/dscl /Search -create / CSPSearchPath /Local/Default /BSD/local /Local/MCX
I’ve seen no particular issues in my environment by installing a preconfigured /Library/Preferences/OpenDirectory/Configurations/Search.plist file.
[…] […]
[…] can read more about Local MCX here. (And yes, Local MCX still works in Mountain […]
[…] my last post, I asserted that Local MCX still works in Mountain Lion. And it does. But that doesn’t mean there aren’t issues to […]
[…] which can then be included by other groups/computers, either using Open Directory or a custom Local MCX deployment. For example, the loginwindow could be configured with a setting that’s […]