ZestyZest
ZestyZest

Reputation: 961

Are there any conditions when launchctl fails to run or load a plist?

Sometimes I see that firing the command doesn't load the app at all. This happens rarely but are there any known conditions or situations where this command would fail? Is there any way to debug launchctl?

launchctl load /Library/LaunchAgents/com.xyz.plist

The contents of the plist are:

<dict>
<key>Label</key>
<string>com.xyz</string>
<key>ProgramArguments</key>
<array>
    <string>/Applications/xyz.app/Contents/MacOS/xyz</string>
</array>
<key>EnvironmentVariables</key>
<dict>
    <key>OPT</key>
    <string>xyz</string>
</dict>
<key>ExitTimeOut</key>
<integer>10</integer>
<key>KeepAlive</key>
<dict>
    <key>SuccessfulExit</key>
    <false/>
</dict>
<key>RunAtLoad</key>
<true/>
<key>EnableTransactions</key>
<false/>

launchctl dumpstate shows STATE=WAITING. Why?

Any help will be appreciable.

Upvotes: 4

Views: 3038

Answers (1)

starlocke
starlocke

Reputation: 3681

Depending on your version of OS X (the breaking point is 10.10, apparently) I've dug up a bunch of resources that should help you debug it, one way or another.

Also... depending on your hardware... I am not joking at all here... "have you tried turning it off and on again?" I've experienced awful Mac Server machines that simply ruin your day by having random errors that magically go away with a reboot.

Upvotes: 1

Related Questions