macos – 我的launchctl配置有什么问题?
作者:互联网
我正试图在登录时自动运行SickBeard
python /Applications/Sick-Beard/Sickbeard.py
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sickbeard.sickbeard</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
<string>/Applications/Sick-Beard/SickBeard.py</string>
<string>-q</string>
<string>-d</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
当我运行launchctl com.sickbeard.sickbeard.plist时,它给我的消息:
launchctl load com.sickbeard.sickbeard.plist launchctl: no plist was
returned for: com.sickbeard.sickbeard.plist launchctl: no plist was
returned for: com.sickbeard.sickbeard.plist nothing found to load
解决方法:
我假设python脚本的路径及其参数是有效的,否则你很可能会在控制台中看到错误.
我最后一次看到这个错误是因为plist中有假的字符,例如额外的空格,导致语法错误,从而使其无法加载.如果您在plist上运行plutil -lint,这将检查您的语法,并轻松报告发生错误的行.
plutil -lint com.sickbeard.sickbeard.plist
如果这没有帮助,那么病态论坛上的(OSX) How To Start SickBeard at Login or boot on OSX帖子与你的plist略有不同(从/usr/local运行的sickbeard而不是/ Applications – 所以它可能是一个权限的东西)而且有些人看起来像same problem就像你一样
标签:python,macos,launchd 来源: https://codeday.me/bug/20190817/1675392.html