3

I'm writing my first launchd plist. When I try to load it with the following command:

$ launchctl load com.Test01.plist
  launchctl: no plist was returned for: com.Test01.plist nothing found to load

The plist is supposed to execute a shell command which writes the date to a file. The plist file follows. It is in ~/Library/LaunchdAgents.

The hardware is a MacBook Air 11 running OS X 10.8.4 Thanks for any comments.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Aple//DTD PLIST 1.0//EN">
<plist version="1.0">
<dict>
    <key>label</key>
    <string>com.Test01</string>

    <key>ProgramArguments</key>
    <array>
            <string>/Users/cae/scripts/testcron.sh</string>
    </array>

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

    <key>Nice</key>
    <integer>1</integer>

    <key>StartInterval</key>
    <integer>60</integer>

    <key>StandardErrorPath</key>
    <string>/Users/cae/tmp/Test01.err</string>

    <key>StandardOutPath</key>
    <string>/Users/cae/tmp/Test01.out</string>
</dict>
</plist>
  • plutil helped me out thanks to this SO answer – rstackhouse Jan 29 '15 at 3:58
  • 1
    @kenorb Mentioned in the comments is that plutil doesn't report this as an error, so I don't think this is a duplicate. – grg Jan 12 '18 at 9:01
6

That error is usually shown when there is a syntax error when checking with plist command.

In this case:

  • label should be Label,
  • and:

    <!DOCTYPE plist PUBLIC "-//Aple//DTD PLIST 1.0//EN">
    

    should be:

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    
  • 1
    Thank you Lauri, capitalizing "Label" solved my issue. One comment: plutil doesn't seem to detect this kind of error, because when checked with it, it reports "ok" with both versions of my script. Again, thanks for the help. – Carlos Jul 18 '13 at 12:34
  • Helped me too. Too bad that plutil doesn't report this problem. – Thomas Apr 21 '14 at 17:07

You must log in to answer this question.

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