Bosco1983

Q: Dock show network shares - Profile Manager

Running server 5 and el cap, if I add network shares to a users dock they show as a question mark which does not resolve when clicked.  I belive this is because of network shares being mapped AFTER the dock has loaded.  This wasnt a problem back in the days of workgroup manager but things have ovviously changed...

 

I've created a login script to "kill the dock" after a period of time.  I also have a logout script which does other things, so I know the correct settings are enabled to allow scripts to be run.

 

Running the .sh script during the users session does refresh the dock and map network shortcuts correctly.  It doesnt however automate like I want it too.  Ive set the script to pause for 20 seconds but this still doesnt work for some reason.

Here is my script, which is saved as a .sh and CHMOD 777 and then uploaded to Profile Manager in the "login scripts" section

 

#!/bin/bash

# Reload Dock

sleep 25

killall -KILL Dock

exit

 

Anything obvious ive done wrong?

 

thanks.

Mac mini, OS X Server

Posted on Apr 28, 2016 6:20 AM

Close

Q: Dock show network shares - Profile Manager

  • All replies
  • Helpful answers

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 28, 2016 7:15 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 28, 2016 7:15 AM in response to Bosco1983

    Just read this in another forum

     

    "

    • The login-hook script runs synchronously before other login actions, and should therefore be kept short.

    "

     

    Which explains why my script wouldn't work as I hoped.  I'll try launching a file from a mapped network volume instead and see if that works.

  • by Bosco1983,Solvedanswer

    Bosco1983 Bosco1983 Apr 29, 2016 4:48 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 29, 2016 4:48 AM in response to Bosco1983

    Reet, sorted it.  This is very much a stitch together job, but seem as though Apple arent fixing this anytime soon its all I got!

     

    Created a basic .App file using Automator (see screenshot).  This waits 2 seconds, and then runs the "killdock" command which refreshes the dock and in doing so shows the network shares on the Dock.

     

    I ran chmod 777 on the file to fix any perm problems, then added to "Packages" to create a .pkg which I then distributed via Munki to a common, local folder with correct perms to be run by everyone.

     

    Then in Server.app I added the dock killer app to login items and shazam!

    At our school we find it useful to add network shares / files to the Dock as well as the desktop.

    Hope this helps someone.

     

    Screen Shot 2016-04-29 at 12.35.26.png