MacOS – launchctl gives permission error

launchdmacospermission

I have a user named 'tv' (OS X 10.11.5) and I have these files in /Users/tv/Library/LaunchAgents/

# ls -lsa /Users/tv/Library/LaunchAgents/
total 16
0 drwxr-xr-x   4 tv  staff   136 Jun 24 20:46 .
0 drwx------@ 50 tv  staff  1700 May 19 11:05 ..
8 -rw-r--r--@  1 tv  staff   487 Dec 24  2015 com.bittorrent.uTorrent.plist
8 -rw-r--r--   1 tv  staff   559 Jun 24 20:46 com.drzoidberg33.plexpy.plist

I get Path had bad ownership/permissions when I try to load either file. I've rebooted, changed the group to wheel, tried to manually load them repeatedly, but I always get the same error. The permissions look exactly the same as on my normal user account:

$ ls -lsa Library/LaunchAgents/
total 8
0 drwxr-xr-x   8 lbutlr  staff   272 Oct  8  2015 .
0 drwx------@ 63 lbutlr  staff  2142 Apr  2 02:11 ..
8 -rw-r--r--   1 lbutlr  staff   452 Mar 30  2015 com.kreme.home.randsig.plist
$ launchctl load /Users/lbutlr/Library/LaunchAgents/com.kreme.home.randsig.plist 
/Users/lbutlr/Library/LaunchAgents/com.kreme.home.randsig.plist: service already loaded`

This link is similar, but is dealing with root permissions inside the /Library folder

Best Answer

The issue turned out to be that the executable referenced in the ProgramArguments inside the plist was not executable. Doh!