我正在尝试在 OS X Mountain Lion 10.8.3 中安排一个简单的任务
launchctl start nextstopsun.helloworld
命令不执行脚本并向控制台抛出消息
4/2/13 9:50:49.663 PM com.apple.launchd.peruser.501[139]: (nextstopsun.helloworld[46729]) Job failed to exec(3) for weird reason: 8
我的 plist 很简单:
<?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>nextstopsun.helloworld</string>
<key>Program</key>
<string>/Users/nextstopsun/Work/scripts/hw.sh</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>21</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
<key>UserName</key>
<string>nextstopsun</string>
</dict>
</plist>
脚本也很简单
echo "Hello World!" > hw.log
launchctl 加载它没有错误。从 shell 执行脚本时,它按预期工作。注销并重新登录无济于事。在谷歌中没有找到任何答案。那个“奇怪的原因:8”到底是怎么回事?