AFP Share don't appear in Dock until After Dock Refresh

TexasITAdmin
New Contributor III

I've added several dock items for applications and these are working just fine.
However, for all the shared drives (other than the AD Network Home) the folders just appear as a "?" until I run a "killall -kill Dock" command to refresh the dock. The drives are mounted, i can open the drives from finder but on the dock they are not clickable until after that refresh.
I think the issue is that the dock is getting configured BEFORE the drive has been mounted but I am uncertain how to resolve this.

10 REPLIES 10

mm2270
Legendary Contributor III

What process are you using to add them to the Dock? The built in Casper Suite dock items? Or something else like dockutil?

TexasITAdmin
New Contributor III

I tried http://errorfreeit.com.au/blog/2015/4/28/dock-master the Dock Master and it won't actually display the shared drives at all, but it does work well for the Adobe Apps.

So I tried using the built in Casper Suite Dock Items. This will display the shared drive on the dock, but it just shows up as a "?" until i reload the dock via killall

mm2270
Legendary Contributor III

Dock Master makes an immutable Dock profile by default, meaning once the Dock config profile is applied, no changes to the Dock are allowed, so that's likely why it did not work to add them.

As for Casper's Dock items, I haven't found it to be the most reliable process, although, theoretically it should work OK for what you're trying to do. What target OS is this on?
You may want to check out using dockutil, but, my first thought is, its kind of overkill if the only thing you need to add are a few servers icons and have them show up. dockutil will restart the Dock once items are added, but the built in Casper function is doing that too, so I'm not sure why they wouldn't be showing up initially. Its possible its running afoul of preference caching. Do a Google search for cfprefsd to see what I mean on that.

TexasITAdmin
New Contributor III

I work for a k-12 at the district level, manage 4 iMac labs, about 100 computers total and after implementing Casper (on trial right now) will manage closer to 200.
Each teacher/class would like a different default dock and different set of Network folders. For example, yearbook just needs browser, InDesign, PhotoShop, YearBook Share, and PhotoShare. While the Journalism class needs Office Apps, PhotoShop, Newspaper Share, and PhotoShare. And so on and so on. So i need to push a different dock config for each class/lab/student depending on the case.
It seemed that login scrips were kind of universal so I wasn't looking into Dockutil because that required a script and i needed a different script to be run depending on the computer location or student's group membership.

TexasITAdmin
New Contributor III

Target os is a mix of 10.9 and 10.10

mm2270
Legendary Contributor III

Hi @TexasITAdmin I'm a little confused about what you meant here:

It seemed that login scrips were kind of universal so I wasn't looking into Dockutil because that required a script and i needed a different script to be run depending on the computer location or student's group membership.

If you meant that you thought you could not use a script to set up the Dock because you already have a login script running, there's nothing saying you can't have multiple policies triggered on login running different scripts. The policies themselves may be able to run based on the type of client system, though I can't say for sure since I don't have knowledge of how your Macs are set up or named. There's probably a dozen different ways you could handle this, and using Casper's Dock item deployment is only one of them. I wouldn't dismiss using something like dockutil simply because you already have some other login functions running.
Also, there's a difference between a Login Hook and a script triggered by Login. Two different things, so hopefully you weren't thinking one superseded the other.

If what I just said doesn't match up with what you meant above, maybe you can clarify.

mm2270
Legendary Contributor III

@TexasITAdmin Taking a step back, here are a few links you should read through on other solutions some are using to get sharepoint access to their users, in their Dock or otherwise.

https://jamfnation.jamfsoftware.com/discussion.html?id=9603
https://macmule.com/2011/09/08/how-to-map-drives-printers-based-on-ad-group-membership-on-osx/

These are just two. There are other ones to look at both here and the internet in general.

TexasITAdmin
New Contributor III

Ah, thanks for the clarification. I think all i need is a script triggered by login. And in fact the JSS dock utility will work just fine for my purposes if I can just get a script that has a 5 second delay and reloads the dock. I'll look further into "script triggered by login" as opposed to login Hooks. Thanks

mm2270
Legendary Contributor III

I should clarify something around the Login Hook, since this could trip you up. If you have deployed your own custom login hook script to your Macs, then login triggers won't really work from policies set up in Casper. The reason is that, Casper uses its own login hook to be able to run login policies. When you go into the Computer Management > Check-In, under Login/Logout Hooks, you have to enable the box labeled "Create login/logout hooks" to be able to use them that way. Be sure to read the description below it. This allows Casper to set up its own login and logout hook scripts that will allow policies using the login trigger to work. If you don't do that, that trigger won't work.
If you've set up custom login hooks on your Macs, you might want to look at migrating whatever functions you are doing in them into a separate policy or policies using the login trigger and enable the option above. This will give you the flexibility to run other policies at login, and not just whatever was in your custom login hook script.

While you're in the tab mentioned above, you may also want to enable the "Perform login hook actions in background" If you don't, the login process may appear delayed a bit to your users since it will wait until the script(s) complete before it gets them to their Desktop.

TexasITAdmin
New Contributor III

I got it mostly sorted out. Thanks for the help!
I did have login hooks enabled but I couldn't remember where to look to verify that, thanks for the tip mm2270.

What seems to work for me is the combination of DockMaster setting an immutable dock, then modifying that imported preference via JSS to add in the network shares. This gives me all the icons i want.

To resolve the "?" issue on the network shares I created a script triggered by login of the following:

#!/bin/bash
sleep 10
killall -kill Dock

This reloads the dock 10 seconds after login, before the computer has even really finished loading, but it happens after the shares have been mounted so now the "?" is replaced with the normal share icon.

Thanks for the links, i'll be going through them, we're a long ways off from putting it into production but all this is helping me make the case for the decision makes to go this direction... We are seriously still using Open Directory on these machines so I'm ready to be 100% done with that and put that "golden triangle" with AD business to rest.