我试图弄清楚为什么我的守护进程不会自动启动(在Mac 10.8.3上)。但是,它在其他机器上运行良好。这是我在/库/ LaunchDaemons的plist/launchd不启动我的守护进程
<?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>com.MyApp.tmsm.launcher</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Application Support/MyApp/tmsmLauncher</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>
我没有看到/var/log/system.log
任何错误消息。我检查了我的daemon
的permission
和owner
。如果我把我的plist放在/System/Library/LaunchDaemons/
之下,它可以在reboot
之后启动。但对我来说这不是一个好的解决方案。如果我使用“launchctl load /Library/LaunchDaemons/com.MyApp.tmsm.launcher
”,它运作良好。如果我安装其他商业软件,这是一个守护进程,并有/Library/LaunchDaemons/
下的plist,它也不能启动。
似乎任何plist根据/Library/LaunchDaemons/
不是由系统加载。我还尝试使用命令“launchctl log level debug
”打开launchctl调试级别,但重新启动后不再有消息。重启后调试级别是否重置?其他日志或配置我可以检查?
谢谢。
请查看作业定义文件。如果发生以下情况,launchd(8)将拒绝加载作业: - 作业定义文件可由“组”或“其他”写入 - 作业定义不属于'root'(或作业定义中指定的用户) - 作业定义文件名不以'.plist'结尾 – LCC
定义文件的权限和所有者是正确的。 '-rw -r - r-- 1个根轮' –