osx - Simple Launchd to run python script -
i'm running every minute debug , keeps returning com.apple.xpc.launchd[1] (com.me.desktopchanger[16390]): service exited abnormal code: 2
<?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> <!-- label should same filename without extension --> <string>com.me.desktopchanger</string> <!-- specify how run program here --> <key>programarguments</key> <array> <string>/usr/bin/python</string> <string>~/library/application\ support/desktopchanger/desktopchanger.py</string> </array> <key>startinterval</key> <integer>60</integer> </dict> </plist> the launchd script called: com.me.desktopchanger.plist
the python script located at: /users/tom/library/application support/desktopchanger/desktopchanger.py
and which python returns: /usr/bin/python
running ls -l returns:
-rw-r--r--@ 1 tom staff 623 6 feb 13:40 com.me.desktopchanger.plist
and python script ls -l shows:
-rwxr-xr-x@ 1 tom staff 672 2 dec 14:24 desktopchanger.py
have tried not using relative path script?
<string>/users/tom/library/application\ support/desktopchanger/desktopchanger.py</string> are using launchcontrol? i'd recommend using can capture standard error in console , see what's underlying abnormal code 2. without launchcontrol, can add these keys .plist:
<key>standarderrorpath</key> <string>/tmp/com.your.thing.err</string> <key>standardoutpath</key> <string>/tmp/com.your.thing.out</string>
Comments
Post a Comment