我有一些自制的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