第二部分: 手动测试服务,以命令的方式快速启动服务,主要是写plist前的验证.
launchctl: 1. 快速验证启动服务程序是否能成功运行,不需要复制org.apache.tomcat.plist到~/Library/LaunchAgents
/Library/LaunchAgents
/Library/LaunchDaemons
/System/Library/LaunchAgents
/System/Library/LaunchDaemons
意思是快速验证一个需要部署的程序是否能正确运行,当然配置也得和plist一样.
[plain]
- launchctl submit -l org.apache.tomcat -o `pwd`/stdout.log -e `pwd`/stderr.log -p /Users/apple/Desktop/apache-tomcat-5.5.25/bin/catalina.sh run
[plain]
- launchctl stop org.apache.tomcat
[plain]
- launchctl remove org.apache.tomcat
表示job已经启动过,需要先停止再移除才可以重新运行.
[plain]
- launchctl stop org.apache.tomcat
- launchctl remove org.apache.tomcat
[plain]
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- At least one of these environment variable is needed to run this program
[plain]
- launchctl setenv JAVA_HOME `/usr/libexec/java_home`
[plain]
- launchctl unsetenv JAVA_HOME
http://blog.csdn.net/infoworld/article/details/47419877