[ale] Tomcat startup script

Joe Steele joe at madewell.com
Fri Feb 1 15:15:56 EST 2002


On Friday, February 01, 2002 12:59 PM, Mike Millson wrote:
>
> I created a Tomcat startup script from a couple sources. Seems to be
> working, just a couple questions.
>
> The script references a file called  /var/run/tomcat.pid. I don't have a on
> my system (RH 7.1, ver 2.4.9-21). Do I need to create it? It looks like it's
> just a file w/ a # in it, the process id I gather? What process id
> would/should I give tomcat?
> 

I don't know specifically about Tomcat.  However, many 
daemons/servers will, when started, create a lock file in /var/run/
<<prog_name>>.pid.  The file contains the pid of the daemon and is 
used to prevent multiple daemons from running at the same time.  It's 
also used for signaling a daemon when there's been a change to its 
configuration (e.g., "at" signals the PID of "atd" whenever it 
creates a new job). When the daemon is shut down, the lock file is 
removed.  Some daemons will create their lock file somewhere other 
than in /var/run/ (sometimes it's in a subdirectory under /var/run).  
In any case, it's not a file that exists all the time, and its 
contents (the pid) is different every time the daemon starts.  After 
you start Tomcat, you'd probably find that it has created a lock file 
in /var/run/.

>
> Also, the script references /var/lock/subsys/tomcat4, another file I don't
> have. What is that file for? Do I need to create it somehow?
> 

This file is created by your script ("touch /var/lock/subsys/tomcat4") 
whenever Tomcat is started ('touch' will create a file if it doesn't 
already exist).  The script removes the file when Tomcat is stopped.  

The file is used by the '/etc/rc.d/rc' script whenever the runlevel 
is changed.  Its existence prevents the needless stopping and 
restarting of a service that is active in both the old and new 
runlevels.

--Joe

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list