第二部分: 手動測試服務,以命令的方式快速啓動服務,主要是寫plist前的驗證.
launchctl:
1. 快速驗證啓動服務程序是否能成功運行,不須要複製org.apache.tomcat.plist到 java
~/Library/LaunchAgentsapache
/Library/LaunchAgentstomcat
/Library/LaunchDaemonsapp
/System/Library/LaunchAgents測試
/System/Library/LaunchDaemonsthis
意思是快速驗證一個須要部署的程序是否能正確運行,固然配置也得和plist同樣.spa
[plain] view plain copy.net
2. 中止服務blog
[plain] view plain copyip
3. 移除當前job裏的服務
[plain] view plain copy
4. 提示錯誤 launchctl run error: File exists
表示job已經啓動過,須要先中止再移除才能夠從新運行.
[plain] view plain copy
5. 配置的輸出提示錯誤,說明沒有配置 JAVA_HOME 環境變量.
[plain] view plain copy
6. 設置環境變量
[plain] view plain copy
7. 刪除環境變量
[plain] view plain copy
http://blog.csdn.net/infoworld/article/details/47419877