Tomcat servlet engine is not running, but pid file exists. What does this message mean? Do I need to recover Tomcat if I get it?
Here's the definition of PID. A PID file is a file that contains a process identifier. 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.
I share @jordanm's comment about using exit codes instead of checking for specific (text) output: the latest version of Tomcat does not even use the messages that you have shown above, so it's very fragile.
If you want a self-re-starting service, considering looking at jsvc, which actually ships with Tomcat binaries in source form.
service-name dead but pid file exists
have you tried :
kill -9 pid
ps -eaf|grep pid
If pid gone now, try :service service-name restart
(stop will fail, but should success when starting)
Pidfile exists, but process is dead
I got it to work by doing:
$ sudo kill -9 <app-pid>
$ node app start
Jenkins dead but pid file exists
Change JENKINS_AJP_PORT="8009"
(OR whatever value) to JENKINS_AJP_PORT="-1"
It will work for sure.
Related Topics
Shell Programming: Executing Two Applications at The Same Time
Removing Parts of a String That Contain Digit with Sed/Perl
Whats The Easiest Way to Send Messages to My Linux Daemon App
Weird Behavior When Prepending to a File with Cat and Tee
Open Website from Within Eclipse's Internal Browser
"Segmentation Fault (Core Dumped)" Error in Fortran Gfortran Linux
Using Find But Only in Subdirectories Matching Certain Pattern
Visual Studio - X11: The Display Environment Variable Is Missing
How to Customize or Remove Extra Linux Kernel Version Details Shown at Boot
Why Sigint Can Stop Bash in Terminal But Not via Kill -Int
Git - How to Remove Branch from Checkout Autocomplete
Iptables Remove Specific Rules by Comment