1

it looks like it loads but has a status of 1 when using launchctl list and using launchctl start ... it says No such Process... i have it saved in /Users/IMG/Library/LaunchAgents. The sh script runs fine. the logging doesn't show anything - no file created.. I am very new to plist so please forgive ignorance.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.IMG.shed</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/IMG/2012/Dropbox/Dev_2012/Java/sh_IMG.sh</string>
    </array>
    <key>StandardOutPath</key>
    <string>myjob.log</string>
    <key>StandardErrorPath</key>
    <string>myjob.log</string>
    <key>Debug</key>
    <true/>

    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>60</integer>
</dict>
</plist>
grievesy
  • 23
  • 5

2 Answers2

2

The first thing I thought was the process does not have permission to create the standard output log file (although I imagine the default value for working directory for a personal agent would be the user's home directory). There is an optional property key for WorkingDirectory - perhaps try setting that to see if anything changes.

Reference: Launchd.plist man page

David J. Liszewski
  • 10,959
  • 6
  • 44
  • 57
  • Thank you.. once i added the path it created a log and i was able to see that it was simply that i need to cd to the correct folder of the sh script.. – grievesy Apr 23 '12 at 01:34
0

In XCode 4.5.2, under the Product menu, you need to pick Edit Scheme. You will see the manage schemes box appear with several schemes. One of these is called Run <ProjectName>. Click the checkbox next to Working Directory Use custom working directory and point that to the path where your plist is at.

This elaborates on the answer given by unhillbilly. So thanks unhillbilly for steering me towards the Working Directory.

Terry Rice
  • 494
  • 7
  • 9