繁体   English   中英

启动错误 - 加载失败:109:无效的属性列表 - 在尝试运行 python 脚本时 -

[英]launchd error - Load failed: 109: Invalid property list - whilst trying to run python script -

我是第一次尝试使用 launchd,我希望自动执行一些脚本。 当我尝试加载我的文件时,出现以下错误:

“加载失败:109:无效的属性列表”

文件名:com.test.daemon.plist

这是我进入终端的命令:

sudo launchctl load -w /Library/LaunchDaemons/com.test.daemon.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>test.plist<</string>
    <key>RunAtLoad</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/python</string>
    <string>playground.py</string>
    </array>
    <key>WorkingDirectory</key>
    <string>/Users/apollo/pycharm/pythonProject3</string>
    <key>StartInterval</key>
    <string>20</string>
    
</dict>
</plist>

我究竟做错了什么?

当我尝试为 Jenkins 代理程序设置守护程序时,我遇到了同样的错误消息,结果发现我使用的是无效的 XML。

在您的示例中,在第 6 行, Label之后的那个被错误地关闭,有一个额外的< ,必须将其删除。 此外,您可能需要调整Label字符串以匹配 launchd 守护程序名称,即。 test.plist替换为com.test.daemon

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM