cancel
Showing results for 
Search instead for 
Did you mean: 

Linux - catalina.pid

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

If the server Linux crash and restart, Alfresco will not start because the PID file exists.
service alfresco restartUsing CATALINA_BASE:   /opt/Alfresco/tomcat
Using CATALINA_HOME:   /opt/Alfresco/tomcat
Using CATALINA_TMPDIR: /opt/Alfresco/tomcat/temp
Using JRE_HOME:        /opt/Alfresco/java
Using CLASSPATH:       /opt/Alfresco/tomcat/bin/bootstrap.jar
PID file (/opt/Alfresco/tomcat/temp/catalina.pid) found but no matching process was found. Stop aborted.
/opt/Alfresco/tomcat/scripts/ctl.sh : tomcat could not be stopped

Why this has been done like this ? Could be not better to automaticly remove this file and write a message in the logs ?
Could I add a command to remove this file in /etc/init.d/alfresco before the start of alfresco without risk ?

Thank you.
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
It's Tomcat's implementation.      You could run on another AS if this bothers you.

You can safely remove the PID file after a crash.

Its probably best not to automatically delete the pid file since it will act as a lock to prevent concurrent instances.

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you mrogers,

I think the best is to create a script "remove catalina.pid" which start before alfresco. (put links to this script in /etc/rc.d/rc3.d/ et /etc/rc.d/rc5.d/).

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

Not tested…


/etc/rc.d/init.d/alfrescopid


#!/bin/sh
#
# chkconfig: 2345 79 31
# description: Remove the catalina.pid for Alfresco Community \
# useful if the server has crashed.
#

RETVAL=0

start () {
   rm -f /opt/Alfresco/tomcat/temp/catalina.pid
   RETVAL=$?   
}

exit $RETVAL

Execute
chmod +x /etc/rc.d/init.d/alfrescopid
chkconfig alfrescopid on