Dockutil issues (again)

CapU
Contributor III

Feel free to shake your head at me. (embarrassed )
I was succesful in creating a pkg that installs dockutil, installs my scripts and plist in the correct location.
When I run the command launchctl load -wF "/Library/LaunchAgents/.plist i get a "Path had bad ownership/permissions" If I give everyone read access to /Library/ the LaunchAgent plist runs. I can use LaunchControl but that just tells me that the plist is not loaded.
My question is what other directory do I need to change permissions on to get the plist to run.
I have to mention that this was all working until I had to change something in my original script and promptly broke the whole thing.
Thanks

2 REPLIES 2

mm2270
Legendary Contributor III

All launchd job plists, both LaunchDaemons and LaunchAgents, need to have the following permissions:
Owner/Group: root/wheel
POSIX 644 (that's owner read/write, group read only, everyone read only)

You can set both of these on the plist from the command line of course.

sudo chown root:wheel /Library/LaunchAgents/<plist name>
sudo chmod 644 /Library/LaunchAgents/<plist name>

As long as the plist is correctly formed and you set those permissions, it should run, barring any issues with the Program Arguments section. But it sounds like its just not loading at all, which typically boils down to permissions being off.

CapU
Contributor III

Thanks @mm2270 (again)
I put the commands you gave me in a postinstall script as I intend this to go on all my new machines arriving in a few months. I figure I can use ARD to fix anything that pops up then.