Solving question marks in the dock
If you’re deploying a lab full of Macs and want to provide easy access to file shares by putting them in the dock, you may find the share icons turning into question marks if you also use a script to restore a shadow home directory on login or logoff.
The question marks will appear if a user mounts one of the file shares by clicking on them, and then logs out and back in again, triggering your home directory cleanup script.
The reason for this is that Mac OS X stores the dock icon cache for each user not in the user’s home directory where one would expect to find it, but rather in the directory/Library/Caches/. Mac OS X separates the iconcaches for each user by the simple expedient of adding the user’s uid to the name of the file, so we end up with files likecom.apple.dock.iconcache.501andcom.apple.dock.iconcache.502.
What happens is that when a user mounts a file share by clicking the icon in the dock, the icon cache gets updated. Things are still okay, though. But when your cleanup script runs and brings back a dock that references an old version of the iconcache, the dock freaks out and displays the question mark.
The solution is to store away/Library/Caches/com.apple.dock.iconcache.XXXwith your shadow home directory, and then restore it at the same time as the home directory.
Voila!No more question marks, at least not in the dock.
Listening to: Stream fromSecret Agent
Posted by Nic Lindh at June 24, 2004 03:21 PM |TrackBack

