Posted on 09-17-2018 07:25 PM
I have been having a hard time getting a custom dock to work for new users. I first tried to use the policy, and that kind of works, but if you create a new user it will keep putting back iBooks, Maps, and Seri. I used dockutil and it runs great from the command line with the new user logged in. I can’t get it to work reliably with a trigger. I have tried the JAMF login trigger and tried outset with the same results. I can see it runs my dockutil script, but dock does not get updated. I just see a log from my script telling me it ran. I have tried a sleep in the script, option to verify Dock is running, both without any luck. Anything I might be missing?
Posted on 09-17-2018 08:16 PM
Are you running it as the logged in user? Something like the following...
user=`ls -la /dev/console | cut -d " " -f 4`
sudo -u $user /usr/local/bin/dockutil --remove 'Siri' --no-restart
sudo -u $user /usr/local/bin/dockutil --remove 'Maps' --no-restart
sudo -u $user /usr/local/bin/dockutil --remove 'iBooks'
Posted on 09-18-2018 07:51 AM
I have tried both
sudo -u $user /usr/local/bin/dockutil --remove 'Siri' --no-restart
and
/usr/local/bin/dockutil --remove 'Siri' --no-restart
Some users are not admin and not in the sudo file. Either way it fails. I think outset runs as the logged in user, but not sure why the script does not run. Once logged in I can run the script and it works fine as the normal user. I know the script is running because I see a log file I create in the user document folder.
Posted on 09-18-2018 09:16 AM
I just tried to put a startup script with a delay of 60 seconds. Here is what I just did and it still fails.
1. Create a login script with a sleep of 60s
2. Have that script call another script to run dockutil
3. The dockutil will run and see the output in the log. I can see the date, time, that it complete, and who ran it.
4. Log shows it running as the local user.
5. Dock does not get set, but i can bring up a terminal and run the same script again and it works fine and the log file looks the same.
I;m at a loss of why this is so hard to do.
Posted on 09-18-2018 08:00 PM
Not to distract, but messing around a bit with docklib and it seems to work quite well (w/ outset). You might give it a glance/compare.
https://github.com/homebysix/docklib
https://github.com/homebysix/docklib/releases