PID file exists, but process is not running

落爺英雄遲暮 提交于 2020-01-02 05:46:18

问题


I'm working in centos6. I have installed tomcat6. At the first all works fine. But after restarting the server tomcat6 did not work properly.

When I execute this command line:"service tomcat6 status" I get: "PID file exists, but process is not running [ÉCHOUÉ]" I checked to the log file "catalina.out" and I get this error:

GRAVE: StandardServer.await: create[8005]:

java.net.BindException: Cannot assign requested address
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at org.apache.catalina.core.StandardServer.await(StandardServer.java:373)
        at org.apache.catalina.startup.Catalina.await(Catalina.java:657)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:617)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Thanks in advance for your helps


回答1:


If Tomcat's startup scripts are run with CATALINA_PID environment variable set properly, then the PID of the Tomcat process will be recorded to a file upon startup. If the file exists when you try to start Tomcat, the scripts will refuse to run because it does not want to clobber a (possibly valid) PID file.

If you are sure that Tomcat is not running, simply delete the file (it should be available through the CATALINA_PID environment variable) and try again.

If you want a self-re-starting service, considering looking at jsvc, which actually ships with Tomcat binaries in source form.




回答2:


Which port you are running tomcat? port 80 or 8080? Any other services running on the same port? Did you check? You can kill tomcat using its process id

ps -ax | grep tomcat
kill -9 <PID>

if you are sure tomcat is the only java application you are running, then you can kill it using,

killall -9 java

watch the catelina.out using tail when you restart it.

something like this,depending on your installation method/path:

tail -f /usr/share/apache-tomcat-6.0.37/logs/catalina.out

Also check in you init scripts or setenv.sh where you configured this PID file. I never used it.




回答3:


First of all Please find port or service name is running in linux services.

ps -ax | grep 8080

then Kill that process

Kill 8080

Then Start your tomcat with this command

sudo service tomcat start 

It will Work.



来源:https://stackoverflow.com/questions/21795718/pid-file-exists-but-process-is-not-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!