我正在尝试在gnome菜单中使用启动器来启动Tomcat服务器。为此,我使用了以下命令“gksu sh / myhome / tomcat_starter”。脚本“tomcat_starter”在启动服务器之前定义了一些环境变量:
#!/bin/bash
JAVA_HOME="/myhome/java"
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
CATALINA_HOME="/myhome/tomcat"
export CATALINA_HOME
$CATALINA_HOME/bin/startup.sh
当启动器启动时,它会按预期要求输入su密码,并启动tomcat服务器。但是服务器在启动后直接关闭。
这是日志文件中的剪切
INFO: Deploying web application directory docs
Oct 01, 2012 11:28:06 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Oct 01, 2012 11:28:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-80"]
Oct 01, 2012 11:28:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Oct 01, 2012 11:28:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1085 ms
Oct 01, 2012 11:28:08 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-80"]
Oct 01, 2012 11:28:09 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Oct 01, 2012 11:28:10 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Oct 01, 2012 11:28:10 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-80"]
Oct 01, 2012 11:28:10 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Oct 01, 2012 11:28:10 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-80"]
Oct 01, 2012 11:28:10 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]<code>
有人知道tomcat服务器关闭的原因吗?
答案 0 :(得分:0)
我发现通过使用命令“nohup”,服务器将继续在后台运行。所以启动器命令现在是“nohup gksu sh / myhome / tomcat_starter”,它运行良好。