You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Pawson <da...@gmail.com> on 2009/02/01 09:20:41 UTC

jsvc problem with PID

Fedora 10, Tomcat 6

Looking to set up a startup/shutdown script
based on
http://www.mythic-beasts.com/support/tomcat-initscript
with paths corrected.

Adding debug I'm seeing, in the logs

INFO: Jk running ID=0 time=0/27  config=null
Feb 1, 2009 7:18:44 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 929 ms
01/02/2009 07:23:58 5575 jsvc.exec error: Cannot open PID file
/var/run/jsvc.pid, PID is 5575
01/02/2009 07:23:58 5574 jsvc.exec error: Service exit with a return
value of 255

I.e. the PID isn't being written to /var/run/jsvc.pid

Any suggestions please?


TIA

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by André Warnier <aw...@ice-sa.com>.
Dave Pawson wrote:
> 2009/2/1 André Warnier <aw...@ice-sa.com>:
> 
>>> I.e. the PID isn't being written to /var/run/jsvc.pid
>>>
>>> Any suggestions please?
>>>
>>>
>> 10..9..8..7..
>> (just the countdown before someone else here tells you to go ask your
>> question in a Fedora forum)
>>
>> A word of explanation, before someone else puts it more rudely :
>> on this Tomcat users forum, most of the helpful people do not have all the
>> various platforms available, where Tomcat /can/ run.  So they tend to
>> concentrate on the "standard" version of Tomcat, as downloaded from the
>> "official" Tomcat site "tomcat.apache.org".
> 
> I did. In preference to $yum install tomcat.
> 
>> That standard Tomcat version does not start in the same way as the version
>> you are using.  For one, it does not, I believe, use the jsvc wrapper which
>> seems to be the source of your problem. jsvc is a separate package, not part
>> of Tomcat itself.
> 
> I built in from the code in $CATALINA-HOME/bin/jsvc-src
> 
> 
Ha ! then I stand corrected, and sorry for my above rambling.
Ok then, maybe one of the helpful Tomcat experts here will be able to 
help after all.  Not me, I'm afraid.

Maybe you *could* try the yum version then ?  that one is almost 
guaranteed to start on your system. ;-)
10..9..8..  (countdown for me this time until someone here reacts to 
that heretical suggestion)

Maybe a less heretical suggestion :
- install the yum package
- save it's /etc/init.d/tomcat6 startup script
- de-install the yum package
- restore the saved /etc/init.d/tomcat6 script and modify it according 
to your "real tomcat" locations

Maybe at least you'll spot the differences.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Dave Pawson <da...@gmail.com>.
2009/2/1 André Warnier <aw...@ice-sa.com>:

>> No. I installed it as a 'normal' user.
>>
>> Workaround:


>> which is nice to know :-)
>>
>
> Yes, but now you are cheating with respect to your first post.
> You are not using jsvc anymore.

No, but it lets me move on a little.


> And, you are running Tomcat as root, which might be considered insecure.

I don't think I am, though I am running into trouble with permissions.

The script is 'mine'
[dpawson@marge atom]$ ls -al /apps/tomcat6/bin/startup.sh
-rwxr-xr-x 1 dpawson dpawson 1956 2008-07-22 02:01 /apps/tomcat6/bin/startup.sh

 it was all installed 'locally'.
Security isn't an issue for this installation... if I get it working.

regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by André Warnier <aw...@ice-sa.com>.
Dave Pawson wrote:
> 2009/2/1 Gregor <rc...@googlemail.com>:
>> are you rumning the startup-script as root?
>>
>> can u post your startup-script?
>>
>> rgds
>>
>> gregor
> 
> No. I installed it as a 'normal' user.
> 
> Workaround:
> 
> case "$1" in
>   start)
>     #
>     # Start Tomcat
>     #
>     sh $CATALINA_HOME/bin/startup.sh
>     ;;
> 
>   stop)
>     #
>     # Stop Tomcat
>     #
>     sh $CATALINA_HOME/bin/shutdown.sh
>     tail $CATALINA_HOME/logs/catalina.out
>     ;;
> 
>  restart)
>     #
>     # Restart
>     #
>     sh $CATALINA_HOME/bin/shutdown.sh
>     sh $CATALINA_HOME/bin/startup.sh
>     ;;
>   *)
>     echo "Usage tomcat.sh start/stop"
>     exit 1;;
> esac
> 
> 
> which is nice to know :-)
> 

Yes, but now you are cheating with respect to your first post.
You are not using jsvc anymore.
And, you are running Tomcat as root, which might be considered insecure.
Which is precisely what jsvc allows you to avoid, in the case where you 
want to run Tomcat as a non-root user, but still have it listen on a 
port < 1024.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Dave Pawson <da...@gmail.com>.
2009/2/2 André Warnier <aw...@ice-sa.com>:

> Just a few points though in defense of the packagers, a much-criticised
> group (to which I do not belong by the way) :

NO critique of their work.
They have different drivers.


> - like the Tomcat people, they are working for free, in a spirit of helping
> other people
> - what they do allows one to install a package (any package), mainly by
> typing "xxxx install package-name", and generally it works right out of the
> box.

? There I'll beg to differ.
Since they dont' provide any documentation, I have to fall back on
TC docs... which are inapplicable (and sufficiently complex in
their own right).

The main issue is a 'standard' layout for a filesystem, which Linux
has been battling for years. Roll on the day.




> - they try to follow the usual conventions of the platform for which they do
> it, which does not necessarily please the original package developers, but
> pleases the sysadmins no end, because one then finds the same kind of files
> in the same usual places (configuration files, logfiles, start/stop scripts
> etc..), without having to scour the whole system to find them
> - they also try to respect the filesystem conventions as to where one puts
> things that get written to or not, permissions and so on
> - they do not generally "break things", they just sometimes tend to spread
> out the files and use a lot of links, which is a bit confusing at first.

Were it documented, it may help. None found.


>
> About the missing pieces, I'm sure that the Tomcat Manager and the Tomcat
> doc are also available, in their own Fedora package.
> The packagers split them off, because they thought (probably justifiably)
> that many people installing Tomcat on real-world servers did not necessarily
> need them.

I'll look. Thanks. Not much help to a newbie.

Tks.


regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by André Warnier <aw...@ice-sa.com>.
Dave Pawson wrote:
[...]

> 
> I tried the Fedora install (instead of the Main Tomcat one).
> It's horribly complex. Installs all over the machine,
> Is missing the manager app and the docs.
> Yuk.
> 
That will be music to the ears of some; can't wait for their comments.
As for me, I'm glad to hear that it is not only the Tomcat Debian 
packager that has a great imagination.

Just a few points though in defense of the packagers, a much-criticised 
group (to which I do not belong by the way) :
- like the Tomcat people, they are working for free, in a spirit of 
helping other people
- what they do allows one to install a package (any package), mainly by 
typing "xxxx install package-name", and generally it works right out of 
the box.
- they try to follow the usual conventions of the platform for which 
they do it, which does not necessarily please the original package 
developers, but pleases the sysadmins no end, because one then finds the 
same kind of files in the same usual places (configuration files, 
logfiles, start/stop scripts etc..), without having to scour the whole 
system to find them
- they also try to respect the filesystem conventions as to where one 
puts things that get written to or not, permissions and so on
- they do not generally "break things", they just sometimes tend to 
spread out the files and use a lot of links, which is a bit confusing at 
first.

About the missing pieces, I'm sure that the Tomcat Manager and the 
Tomcat doc are also available, in their own Fedora package.
The packagers split them off, because they thought (probably 
justifiably) that many people installing Tomcat on real-world servers 
did not necessarily need them.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Dave Pawson <da...@gmail.com>.
2009/2/1 Qiao Jin <br...@gmail.com>:
> Could it be that you are running the start-up script (the one using jsvc) as a normal user and thus does not have the permission to write to /var/run? In my system, CentOS 5, /var/run can only be written by root. I run my jsvc script as root and use the "-user" option to switch to a normal user after binding to port 80.

That makes sense, thanks.
So root runs the script, but the user 'used' as the parameter is a normal user.

I'll try that.

ps.

I tried the Fedora install (instead of the Main Tomcat one).
It's horribly complex. Installs all over the machine,
Is missing the manager app and the docs.
Yuk.

regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: jsvc problem with PID

Posted by Qiao Jin <br...@gmail.com>.
Could it be that you are running the start-up script (the one using jsvc) as a normal user and thus does not have the permission to write to /var/run? In my system, CentOS 5, /var/run can only be written by root. I run my jsvc script as root and use the "-user" option to switch to a normal user after binding to port 80.  

-Qiao

-----Original Message-----
From: Dave Pawson [mailto:dave.pawson@gmail.com] 
Sent: Sunday, February 01, 2009 5:12 AM
To: Tomcat Users List
Subject: Re: jsvc problem with PID

2009/2/1 Gregor <rc...@googlemail.com>:
> are you rumning the startup-script as root?
>
> can u post your startup-script?
>
> rgds
>
> gregor

No. I installed it as a 'normal' user.

Workaround:

case "$1" in
  start)
    #
    # Start Tomcat
    #
    sh $CATALINA_HOME/bin/startup.sh
    ;;

  stop)
    #
    # Stop Tomcat
    #
    sh $CATALINA_HOME/bin/shutdown.sh
    tail $CATALINA_HOME/logs/catalina.out
    ;;

 restart)
    #
    # Restart
    #
    sh $CATALINA_HOME/bin/shutdown.sh
    sh $CATALINA_HOME/bin/startup.sh
    ;;
  *)
    echo "Usage tomcat.sh start/stop"
    exit 1;;
esac


which is nice to know :-)


regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Dave Pawson <da...@gmail.com>.
2009/2/1 Gregor <rc...@googlemail.com>:
> are you rumning the startup-script as root?
>
> can u post your startup-script?
>
> rgds
>
> gregor

No. I installed it as a 'normal' user.

Workaround:

case "$1" in
  start)
    #
    # Start Tomcat
    #
    sh $CATALINA_HOME/bin/startup.sh
    ;;

  stop)
    #
    # Stop Tomcat
    #
    sh $CATALINA_HOME/bin/shutdown.sh
    tail $CATALINA_HOME/logs/catalina.out
    ;;

 restart)
    #
    # Restart
    #
    sh $CATALINA_HOME/bin/shutdown.sh
    sh $CATALINA_HOME/bin/startup.sh
    ;;
  *)
    echo "Usage tomcat.sh start/stop"
    exit 1;;
esac


which is nice to know :-)


regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Gregor <rc...@googlemail.com>.
are you rumning the startup-script as root?

can u post your startup-script?

rgds

gregor

Am 01.02.2009 um 12:00 schrieb Dave Pawson <da...@gmail.com>:

> 2009/2/1 André Warnier <aw...@ice-sa.com>:
>
>>> I.e. the PID isn't being written to /var/run/jsvc.pid
>>>
>>> Any suggestions please?
>>>
>>>
>> 10..9..8..7..
>> (just the countdown before someone else here tells you to go ask your
>> question in a Fedora forum)
>>
>> A word of explanation, before someone else puts it more rudely :
>> on this Tomcat users forum, most of the helpful people do not have  
>> all the
>> various platforms available, where Tomcat /can/ run.  So they tend to
>> concentrate on the "standard" version of Tomcat, as downloaded from  
>> the
>> "official" Tomcat site "tomcat.apache.org".
>
> I did. In preference to $yum install tomcat.
>
>> That standard Tomcat version does not start in the same way as the  
>> version
>> you are using.  For one, it does not, I believe, use the jsvc  
>> wrapper which
>> seems to be the source of your problem. jsvc is a separate package,  
>> not part
>> of Tomcat itself.
>
> I built in from the code in $CATALINA-HOME/bin/jsvc-src
>
>
> regards
>
>
>
> -- 
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Dave Pawson <da...@gmail.com>.
2009/2/1 André Warnier <aw...@ice-sa.com>:

>> I.e. the PID isn't being written to /var/run/jsvc.pid
>>
>> Any suggestions please?
>>
>>
> 10..9..8..7..
> (just the countdown before someone else here tells you to go ask your
> question in a Fedora forum)
>
> A word of explanation, before someone else puts it more rudely :
> on this Tomcat users forum, most of the helpful people do not have all the
> various platforms available, where Tomcat /can/ run.  So they tend to
> concentrate on the "standard" version of Tomcat, as downloaded from the
> "official" Tomcat site "tomcat.apache.org".

I did. In preference to $yum install tomcat.

> That standard Tomcat version does not start in the same way as the version
> you are using.  For one, it does not, I believe, use the jsvc wrapper which
> seems to be the source of your problem. jsvc is a separate package, not part
> of Tomcat itself.

I built in from the code in $CATALINA-HOME/bin/jsvc-src


regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by André Warnier <aw...@ice-sa.com>.
Dave Pawson wrote:
> Fedora 10, Tomcat 6
> 
> Looking to set up a startup/shutdown script
> based on
> http://www.mythic-beasts.com/support/tomcat-initscript
> with paths corrected.
> 
> Adding debug I'm seeing, in the logs
> 
> INFO: Jk running ID=0 time=0/27  config=null
> Feb 1, 2009 7:18:44 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 929 ms
> 01/02/2009 07:23:58 5575 jsvc.exec error: Cannot open PID file
> /var/run/jsvc.pid, PID is 5575
> 01/02/2009 07:23:58 5574 jsvc.exec error: Service exit with a return
> value of 255
> 
> I.e. the PID isn't being written to /var/run/jsvc.pid
> 
> Any suggestions please?
> 
> 
10..9..8..7..
(just the countdown before someone else here tells you to go ask your 
question in a Fedora forum)

A word of explanation, before someone else puts it more rudely :
on this Tomcat users forum, most of the helpful people do not have all 
the various platforms available, where Tomcat /can/ run.  So they tend 
to concentrate on the "standard" version of Tomcat, as downloaded from 
the "official" Tomcat site "tomcat.apache.org".
That standard Tomcat version does not start in the same way as the 
version you are using.  For one, it does not, I believe, use the jsvc 
wrapper which seems to be the source of your problem. jsvc is a separate 
package, not part of Tomcat itself.

The version you are using, is a pre-packaged version, from your Linux 
flavor's packaging experts, who have created their own method to start 
Tomcat, using their own scripts etc, and jsvc.  They have probably very 
good reasons to do that, and that is not the point.  The point is that 
people here do not generally know what happens in one of these 
platform-specific versions.

In other words, basically, you would have more chances of being helped 
by asking the Fedora people for help.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Jose Vicente Nunez Zuleta <jo...@gmail.com>.
Hi, not an expert, but if the PID variable is empty or the pid file is  
not there then you will have problems (like when the daemon was killed  
before). Try this:

stop)
     PIDFILE="/var/run/jsvc.pid"
      if [ -f "$PIDFILE" ]; then
           PID=`cat $PIDFILE`
           if [ $? == 0 && ! -z $PID ]; then
                 kill $PID
           fi
      fi



On Feb 1, 2009, at 9:08 AM, Dave Pawson wrote:

> 2009/2/1 Brian Millett <bm...@gmail.com>:
>
>> Well, I use the jsvc daemon to start my tomcat on fedora 10.   
>> Tomcat 6
>>
>> your mileage will vary, but here is my start stript.
>
>
>> stop)
>>   #
>>   # Stop Tomcat
>>   #
>>   PID=`cat /var/run/jsvc.pid`
>>   kill $PID
>>   ;;
>>
>> *)
>>   echo "Usage tomcat.sh start/stop"
>>   exit 1
>>   ;;
>> esac
>
>
> The stop is just the same as mine.
> [dpawson@marge atom]$ tc stop
> cat: /var/run/jsvc.pid: No such file or directory
> kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec
> ... or kill -l [sigspec]
>
>
>
> Whilst running, is the file found in /var/run Brian?
>
>
> regards
>
> -- 
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Dave Pawson <da...@gmail.com>.
2009/2/1 Brian Millett <bm...@gmail.com>:

> Well, I use the jsvc daemon to start my tomcat on fedora 10.  Tomcat 6
>
> your mileage will vary, but here is my start stript.


>  stop)
>    #
>    # Stop Tomcat
>    #
>    PID=`cat /var/run/jsvc.pid`
>    kill $PID
>    ;;
>
>  *)
>    echo "Usage tomcat.sh start/stop"
>    exit 1
>    ;;
> esac


The stop is just the same as mine.
[dpawson@marge atom]$ tc stop
cat: /var/run/jsvc.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec
... or kill -l [sigspec]



Whilst running, is the file found in /var/run Brian?


regards

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: jsvc problem with PID

Posted by Brian Millett <bm...@gmail.com>.
On Sun, 2009-02-01 at 08:20 +0000, Dave Pawson wrote:
> Fedora 10, Tomcat 6
> 
> Looking to set up a startup/shutdown script
> based on
> http://www.mythic-beasts.com/support/tomcat-initscript
> with paths corrected.
> 
> Adding debug I'm seeing, in the logs
> 
> INFO: Jk running ID=0 time=0/27  config=null
> Feb 1, 2009 7:18:44 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 929 ms
> 01/02/2009 07:23:58 5575 jsvc.exec error: Cannot open PID file
> /var/run/jsvc.pid, PID is 5575
> 01/02/2009 07:23:58 5574 jsvc.exec error: Service exit with a return
> value of 255
> 
> I.e. the PID isn't being written to /var/run/jsvc.pid
> 
> Any suggestions please?
> 

Well, I use the jsvc daemon to start my tomcat on fedora 10.  Tomcat 6

your mileage will vary, but here is my start stript.  I also use the apr
native libs hence the -Djava.library.path=/usr/local/apr/lib and I've
also setup monitoring 


#!/bin/sh
#
# chkconfig: 345 86 15
# description: Tomcat Server
#
# Small shell script to show how to start/stop Tomcat using jsvc
# If you want to have Tomcat running on port 80 please modify the
server.xml
# file:
#
#    <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
#    <Connector
className="org.apache.catalina.connector.http.HttpConnector"
#               port="80" minProcessors="5" maxProcessors="75"
#               enableLookups="true" redirectPort="8443"
#               acceptCount="10" debug="0" connectionTimeout="60000"/>
#
# You need a developement version of Tomcat (Apache Tomcat/4.1-dev)
#
# Adapt the following lines to your configuration
JAVA_HOME=/usr/jdk
CATALINA_HOME=/opt/tomcat
CATALINA_BASE=/opt/webBaseDir
DAEMON_HOME=/usr/local/bin
TOMCAT_USER=tomcat
TMP_DIR=$CATALINA_BASE/temp
CATALINA_OPTS=" -Djava.library.path=/usr/local/apr/lib
 -Djava.awt.headless=true
 -Xms128M -Xmx512M
 -XX:+UseParallelOldGC
 -Dcom.sun.management.jmxremote
 -Dcom.sun.management.jmxremote.port=9086
 -Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false
"
CLASSPATH=\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/tomcat-juli.jar:\
$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
  start)
    #
    # Start Tomcat
    #
    $DAEMON_HOME/jsvc \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -jvm server \
    -Dcatalina.home=$CATALINA_HOME \
    -Dcatalina.base=$CATALINA_BASE \
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
    -Djava.util.logging.config.file=
$CATALINA_BASE/conf/logging.properties \
    -Djava.endorsed.dirs=$CATALINA_BASE/endorsed \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_BASE/logs/catalina.out \
    -errfile '&1' \
    $CATALINA_OPTS \
    -cp $CLASSPATH \
    org.apache.catalina.startup.Bootstrap
    #
    # To get a verbose JVM
    #-verbose \
    # To get a debug of jsvc.
    #-debug \
    ;;

  stop)
    #
    # Stop Tomcat
    #
    PID=`cat /var/run/jsvc.pid`
    kill $PID
    ;;

  *)
    echo "Usage tomcat.sh start/stop"
    exit 1
    ;;
esac


-- 
Brian Millett - [ Londo and Sinclair, "A Voice in the Wilderness I"]
"If the Narns all stood together in one place and hated all at the same
    time, that hatred could fly across dozens of light years and reduce
    Centauri Prime to a ball of ash. That's how much they hate *us*."
'You don't have to respond in kind.'
"Of course we do. It is a natural law. Physics tells us that for every
    action, there must be an equal and opposite reaction. They hate us,
    we hate them, they hate us back and so, here we are, victims of
    mathematics."