![如何使用“script -c”命令启动tomcat?](https://linux22.com/image/1576141/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E2%80%9Cscript%20-c%E2%80%9D%E5%91%BD%E4%BB%A4%E5%90%AF%E5%8A%A8tomcat%EF%BC%9F.png)
我想使用以下命令启动 tomcat:
script -c "sh /usr/program/tomcat/tomcat-8.0.50/bin/startup.sh"
运行命令后,控制台显示tomcat启动成功。
但ps -ef | grep tomcat
显示tomcat没有启动。
然后我尝试使用script
不带选项的命令-c
:
[root@xxx test]#script
Script started, file is typescript01
[root@xxx test]# sh /usr/program/tomcat/tomcat-8.0.50/bin/startup.sh
Using CATALINA_BASE: /usr/program/tomcat/tomcat-8.0.50
Using CATALINA_HOME: /usr/program/tomcat/tomcat-8.0.50
Using CATALINA_TMPDIR: /usr/program/tomcat/tomcat-8.0.50/temp
Using JRE_HOME: /usr/program/java/jdk1.8.0_112
Using CLASSPATH: /usr/program/tomcat/tomcat-8.0.50/bin/bootstrap.jar:/usr/program/tomcat/tomcat-8.0.50/bin/tomcat-juli.jar
Tomcat started.
然后ps -ef | grep tomcat
显示tomcat已经启动了。
我怎样才能启动 tomcat script -c
?