我已经在我的mac mini服务器上为2个用户启动了使用Lingon的getmail。一个用户的getmail运行正常而另一个用户没有运行。启动项的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>GroupName</key>
<string>staff</string>
<key>Label</key>
<string>org.intelmini.maggie-mail</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/getmail</string>
</array>
<key>RootDirectory</key>
<string>/Users/maggie</string>
<key>ServiceDescription</key>
<string>Maggies getmail</string>
<key>StartInterval</key>
<integer>600</integer>
<key>UserName</key>
<string>maggie</string>
<key>WorkingDirectory</key>
<string>/Users/maggie</string>
</dict>
</plist>
我从launchd得到的错误是:
Jan 19 08:30:31 intelmini com.apple.launchd[1] (org.intelmini.maggie-mail[7928]): Bug: launchd_core_logic.c:4194 (24498):2
Jan 19 08:30:31 intelmini com.apple.launchd[1] (org.intelmini.maggie-mail[7928]): posix_spawn("/opt/local/bin/getmail", ...): No such file or directory
Jan 19 08:30:31 intelmini com.apple.launchd[1] (org.intelmini.maggie-mail[7928]): Exited with exit code: 1
但是该文件显然存在:
intelmini:~ maggie$ ls -l /opt/local/bin/getmail
lrwxr-xr-x 1 root admin 71 10 Jan 08:42 /opt/local/bin/getmail -> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/getmail
当我以该用户身份登录时,确实它可以从终端运行:
intelmini:~ maggie$ getmail
getmail version 4.22.2
Copyright (C) 1998-2009 Charles Cazabon. Licensed under the GNU GPL version 2.
SimplePOP3Retriever:maggie@mail2.gmn-usa.com:110:
0 messages (0 bytes) retrieved, 124 skipped
是的,所以我不知道如何解决这个问题。运行getmail的用户都是admin。
我删除了任务并通过launchctl重新添加它,现在它可以工作了。所以我还是真的很困惑。也许这是Lingon的错?这是我最初用来添加任务的内容。
—
烦恼
我只是在运行邮件服务器的mac上重新安装了OSX,并且需要让launchd脚本再次运行...所以我搜索网络...并且从最后一次找到我未经回答的帖子我做到了......好笑。
—
烦恼