如何使用「script -c」指令啟動tomcat?

如何使用「script -c」指令啟動tomcat?

我想用以下命令啟動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

相關內容