【发布时间】:2014-05-08 14:28:49
【问题描述】:
我在以下三个不同位置运行launchctl load 命令时遇到了相同的错误launchctl: Dubious ownership on file (skipping): ~.plist
nothing found to load,但它们都不起作用:
sudo launchctl load /Library/LaunchDaemons/updates.novel.plist
sudo launchctl load /Library/LaunchAgents/updates.novel.plist
sudo launchctl load /Users/username/Library/LaunchAgents/updates.novel.plist
下面是我的updates.novel.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>admin</string>
<key>UserName</key>
<string>Username</string>
<key>Debug</key>
<true/>
<key>Label</key>
<string>updates.novel</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/AMPPS/php-5.3/bin/php</string>
<string>/Applications/AMPPS/www/files/allnovels/novel.php</string>
<string>--daemon</string>
</array>
<key>StandardErrorPath</key>
<string>/var/log/files/error.1.log</string>
<key>StandardOutPath</key>
<string>/var/log/files/error.2.log</string>
<key>RunAtLoad</key>
<true/>
<key>AbandonProcessGroup</key>
<true/>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>14</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
【问题讨论】:
-
见apple.stackexchange.com/questions/3250/…,谷歌搜索“启动可疑所有权”时的最高结果。
-
@zneak,我已经尝试
sudo chmod 644 <filename>,但没有成功。 -
当您尝试使用与文件所属用户不同的用户启动服务时,您会收到可疑的所有权消息。如果你使用
sudo,它需要归root所有,但你不需要使用sudo。 -
@zneak,非常感谢,你是对的。我把用户名改成
root,运行launchctl load /Library/LaunchAgents/updates.novel.plist,终于成功了,干杯,
标签: macos cron osx-mavericks launchd