Arif Ali Saiyed
Arif Ali Saiyed

Reputation: 657

Troubleshooting LaunchAgent (LaunchAgent not starting loading)

I had I had a problem in starting the LaunchAgent and googled a lot and found multiple methods to troubleshoot, Noting them all down here in one place for the benefits of others

Upvotes: 0

Views: 1016

Answers (1)

Arif Ali Saiyed
Arif Ali Saiyed

Reputation: 657

1) Ensure that after agents are copied in /Library/LaunchAgent folder reads as following.

-rw-r--r--  1 root  wheel  798 Jun  5 11:52 /Library/LaunchAgents/com.mycompany.myproduct.LaunchAgent.plist

(When you manually copy these files for debugging, you may have manually change these attributes using chown and chgroup commands).

2) Ensure that the path given in plist-> ProgramArguments is correct. (note that space is not required here)

3) Ensure that execution permission exists for file specified in "launchAgent plist->ProgramArguments"

4) check RunAtLoad attribute

5) Ensure that WatchPath file is present, please check if the the WatchPath need need any parameterization like /path/dir1/dir2/productname%BUILDNO%.trigger

6) if there is a file com.mycompanynewname.MyProductLaunchAgent.plist in the folder it may conflict with com.mycompanyoldname.MyProductLaunchAgent.plist

7) Look for /var/log/system.log for launchctl specific logs.

8) Read more about how LaunchDemon and LaunchAgent works and Apple documentation and http://www.launchd.info/

Upvotes: 2

Related Questions