我有一些自制的Launchd脚本。但是我有当我重新启动我的电脑手动运行它们:如何调试启动时不运行的Launchd脚本?
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.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>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>Program</key>
<string>/Users/dash/.local/Cellar/mysql/5.1.49/bin/mysqld_safe</string>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>dash</string>
<key>WorkingDirectory</key>
<string>/Users/dash/.local/var</string>
</dict>
</plist>
我想这应该发生在启动时。我错过了什么?
我不认为这会有任何效果(因此,我没有把它作为答案),但尝试运行它没有测试的“-w”标志(即“launchctl加载〜/ Library/LaunchAgents /com.mysql.mysqld.plist“),然后重新启动。或者,也许试试plist的完整文件路径(例如/Users/{you}/Library/LaunchAgents/com.mysql.mysqld.plist)。只是在这里猜测。 – 2011-07-31 03:10:05
不是一个真正的答案,但我确信[LaunchControl](http://www.soma-zone.com/LaunchControl)会告诉你为什么。 – LCC 2013-09-05 14:30:03
查看我的[回复](http://stackoverflow.com/a/15820488/711807)到类似的问题。 – 2014-05-27 00:22:49