我已经在 mac mini 服务器上使用 launchd 中的 Lingon 为 2 个用户设置了 getmail。一个用户的 getmail 运行良好,而另一个用户的则不行。launchd 条目的 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:[email protected]:110:
0 messages (0 bytes) retrieved, 124 skipped
是的,所以我不知道该如何解决这个问题。运行 getmail 的两个用户都是管理员。