我在Ubuntu中运行jetty 7作为服务时遇到了麻烦。
Jetty 6运行正常,但我不得不升级。我遇到的问题是Jetty启动了两个java进程,在从我复制到/etc/init.d或直接从jettys bin文件夹复制的脚本中停止后,仍有一个进程:
~/jetty/bin$ sudo ./jetty.sh start
Starting Jetty: OK
~/jetty/bin$ ps ax | grep jetty
28888 ? Sl 0:00 /usr/bin/java -Djetty.home=/usr/share/jetty -Djava.io.tmpdir=/tmp -jar /usr/share/jetty/start.jar --pre=etc/jetty-logging.xml --daemon
28904 ? Sl 0:05 /usr/lib/jvm/java-6-sun-1.6.0.22/jre/bin/java -Xmx2000m -Xmn512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -Djetty.home=/usr/share/jetty -cp /usr/share/jetty/lib/jetty-xml-7.3.0.v20110203.jar:/usr/share/jetty/lib/servlet-api-2.5.jar:/usr/share/jetty/lib/jetty-http-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-continuation-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-server-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-security-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-servlet-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-webapp-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-deploy-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-servlets-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-jmx-7.3.0.v20110203.jar:/usr/share/jetty/lib/jsp/com.sun.el_1.0.0.v201004190952.jar:/usr/share/jetty/lib/jsp/ecj-3.6.jar:/usr/share/jetty/lib/jsp/javax.el_2.1.0.v201004190952.jar:/usr/share/jetty/lib/jsp/javax.servlet.jsp_2.1.0.v201004190952.jar:/usr/share/jetty/lib/jsp/javax.servlet.jsp.jstl_1.2.0.v201004190952.jar:/usr/share/jetty/lib/jsp/jetty-jsp-2.1-7.3.0.v20110203.jar:/usr/share/jetty/lib/jsp/org.apache.jasper.glassfish_2.1.0.v201007080150.jar:/usr/share/jetty/lib/jsp/org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar:/usr/share/jetty/resources:/usr/share/jetty/lib/jetty-websocket-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-util-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-io-7.3.0.v20110203.jar org.eclipse.jetty.xml.XmlConfiguration /tmp/start6429233784810245794.properties /usr/share/jetty/etc/jetty-logging.xml /usr/share/jetty/etc/jetty.xml /usr/share/jetty/etc/jetty-deploy.xml /usr/share/jetty/etc/jetty-webapps.xml /usr/share/jetty/etc/jetty-contexts.xml /usr/share/jetty/etc/jetty-testrealm.xml
28938 pts/1 R+ 0:00 grep jetty
~/jetty/bin$ sudo ./jetty.sh stop
Stopping Jetty: OK
~/jetty/bin$ ps ax | grep jetty
28904 ? Sl 0:31 /usr/lib/jvm/java-6-sun-1.6.0.22/jre/bin/java -Xmx2000m -Xmn512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -Djetty.home=/usr/share/jetty -cp /usr/share/jetty/lib/jetty-xml-7.3.0.v20110203.jar:/usr/share/jetty/lib/servlet-api-2.5.jar:/usr/share/jetty/lib/jetty-http-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-continuation-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-server-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-security-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-servlet-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-webapp-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-deploy-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-servlets-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-jmx-7.3.0.v20110203.jar:/usr/share/jetty/lib/jsp/com.sun.el_1.0.0.v201004190952.jar:/usr/share/jetty/lib/jsp/ecj-3.6.jar:/usr/share/jetty/lib/jsp/javax.el_2.1.0.v201004190952.jar:/usr/share/jetty/lib/jsp/javax.servlet.jsp_2.1.0.v201004190952.jar:/usr/share/jetty/lib/jsp/javax.servlet.jsp.jstl_1.2.0.v201004190952.jar:/usr/share/jetty/lib/jsp/jetty-jsp-2.1-7.3.0.v20110203.jar:/usr/share/jetty/lib/jsp/org.apache.jasper.glassfish_2.1.0.v201007080150.jar:/usr/share/jetty/lib/jsp/org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar:/usr/share/jetty/resources:/usr/share/jetty/lib/jetty-websocket-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-util-7.3.0.v20110203.jar:/usr/share/jetty/lib/jetty-io-7.3.0.v20110203.jar org.eclipse.jetty.xml.XmlConfiguration /tmp/start6429233784810245794.properties /usr/share/jetty/etc/jetty-logging.xml /usr/share/jetty/etc/jetty.xml /usr/share/jetty/etc/jetty-deploy.xml /usr/share/jetty/etc/jetty-webapps.xml /usr/share/jetty/etc/jetty-contexts.xml /usr/share/jetty/etc/jetty-testrealm.xml
~/jetty/bin$ sudo kill 28904
~/jetty/bin$ ps ax | grep jetty
29017 pts/1 S+ 0:00 grep jetty
一直手动杀死它真的很烦人。谁知道为什么?
更多信息: 似乎“错误”进程存储在pid文件中,然后由stop-script停止:如果我手动杀死另一个,则两个都停止。
答案 0 :(得分:1)
您是否尝试过“服务码头停止”/“服务码头启动”?
答案 1 :(得分:0)
您应该尝试使用init-scripts。
您可以从头开始撰写或安装.deb packages with scripts already included: (Or here)。
不要担心Debian通知。它也适合Ubuntu。
答案 2 :(得分:-2)
nano / etc / default / jetty
cambiar:
NO_START = 1
POR:
NO_START = 0
luego ejecuta:
服务码头开始