4

I have created the plist and placed it in /System/Library/LaunchAgents/. However, when I reboot my Mac it does not load like it is expected to. I am able to load it from the Terminal with launchctl load and unload commands and it is perfectly loaded from there. And also I have checked the console after reboot and it does not have any entry related to the plist.

How can I get this plist to run on boot?

  • 1
    Let's see the plist – user151019 Oct 16 '13 at 10:55
3

Is the property list owned by root? If it is not, it is not loaded on login even if launchctl load (without sudo) would load it.

$ sudo launchctl load /Library/LaunchAgents/test.plist 
launchctl: Dubious ownership on file (skipping): /Library/LaunchAgents/test.plist
nothing found to load
$ sudo chown root /Library/LaunchAgents/test.plist 
$ sudo launchctl load /Library/LaunchAgents/test.plist 
$ 

If the program is meant to be run when the property list is loaded, set RunAtLoad to true:

<key>RunAtLoad</key>
<true/>

Also you can normally use /Library/LaunchAgents/ instead of /System/Library/LaunchAgents/. From man launchd:

~/Library/LaunchAgents         Per-user agents provided by the user.
/Library/LaunchAgents          Per-user agents provided by the administrator.
/Library/LaunchDaemons         System-wide daemons provided by the administrator.
/System/Library/LaunchAgents   Per-user agents provided by Mac OS X.
/System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.

Not the answer you're looking for? Browse other questions tagged .