tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renaud Waldura" <renaud+tom...@waldura.com>
Subject Re: Re: how to use jsvc to stop the tomcat service
Date Sun, 06 Aug 2006 01:15:39 GMT
BTW the newer jsvc with "-stop" option is at:
http://jakarta.apache.org/commons/daemon/jsvc.html

I had to look far and wide -- wasn't obvious to me.



----- Original Message ----- 
From: "Warren Pace" <wapace@bellsouth.net>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Saturday, August 05, 2006 4:34 AM
Subject: Re: Re: how to use jsvc to stop the tomcat service


> Patrick,
>      I did compile jsvc for tc version 5.5.15 and there may be 
> differences.  Try the command:
> /bin/jsvc -help  that will list your available options.  My version 
> indicates that -stop has to be combined with -pidfile.
>>
>> From: "Patrick Wang" <pwang@uclink.berkeley.edu>
>> Date: 2006/08/04 Fri PM 03:23:39 EDT
>> To: "'Patrick Wang'" <pwang@uclink.berkeley.edu>,
>> <users@tomcat.apache.org>
>> Subject: Re: how to use jsvc to stop the tomcat service
>>
>>
>>
>> Warren:
>>
>>
>>
>> Thanks for the help. I tried to run the command line /bin/jsvc \
>>
>> *                   -stop
>>
>>
>>
>> It said -stop is not a recognized option. I listed the jsvc -help and did 
>> not
>> see such an option for the jsvc command.
>>
>>
>>
>> I will do more investigation.
>>
>>
>>
>>
>>
>>
>>
>> Pat
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Warren Pace [mailto:wapace@bellsouth.net]
>> Sent: Thursday, August 03, 2006 2:28 PM
>> To: Tomcat Users List
>> Subject: Re: Re: how to use jsvc to stop the tomcat service
>>
>>
>>
>> Pat,
>>
>>      See reply below.  I left out the left curly brace in the   if [ ! -x
>> ${JSVC_BIN} ]; then
>>
>> statement.  Sorry, didn't proof-read before I hit send...
>>
>> >
>>
>> > From: Warren Pace <wapace@bellsouth.net>
>>
>> > Date: 2006/08/03 Thu PM 05:20:47 EDT
>>
>> > To: "Tomcat Users List" <users@tomcat.apache.org>
>>
>> > Subject: Re: how to use jsvc to stop the tomcat service
>>
>> >
>>
>> >
>>
>> > >
>>
>> > > From: "Patrick Wang" <pwang@uclink.berkeley.edu>
>>
>> > > Date: 2006/08/03 Thu PM 02:27:35 EDT
>>
>> > > To: "'Tomcat Users List'" <users@tomcat.apache.org>
>>
>> > > Subject: how to use jsvc to stop the tomcat service
>>
>> > >
>>
>> > > Hi All:
>>
>> > >
>>
>> > > I am using TOMCAT 5.0.28, I found the following command to start a 
>> > > tomcat
>>
>> > > instance on the documentation page, however it did not mention how to 
>> > > stop
>> the
>>
>> > > tomcat, I am currently using kill <<processed>> and wondering
if 
>> > > there is a
>> more
>>
>> > > elegant solution.
>>
>> > >
>>
>> > > Thanks
>>
>> > >
>>
>> > > Pat
>>
>> > >
>> ===============================================================================
>>
>> > >
>>
>> > > ./bin/jsvc -Djava.endorsed.dirs=./common/endorsed -cp 
>> > > ./bin/bootstrap.jar \
>>
>> > >         -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
>>
>> > >         org.apache.catalina.startup.Bootstrap
>>
>> > >
>>
>> > write a shell script for init.d something like the one listed below 
>> > named
>> tomcat5, make it executable and save it in /etc/init.d.  You can specify
>> processes you need to have running before tomcat starts,etc.  Since I use 
>> jdbc
>> realms, I specify that mysql should be running before tomcat starts. Of 
>> course,
>> you'll have to change these paths to match your system.  Then you can 
>> start,
>> stop or restart tomcat by typing in /etc/init.d/tomcat5 start or
>> /etc/init.d/tomcat5 stop or /etc/init.d/tomcat5 restart.  You'll want to 
>> play
>> with the Xms/Xmx section to set the minium & maximum system memory you 
>> allow.
>>
>> > You should be able to use the script to start tomcat at system startup 
>> > as
>> well.
>>
>> >
>>
>> > #!/bin/sh
>>
>> > # /etc/init.d/tomcat5
>>
>> > #
>>
>> > ### BEGIN INIT INFO
>>
>> > # Provides:             tomcat5
>>
>> > # Required-Start:   $network $remote_fs mysql
>>
>> > # X-UnitedLinux-Should-Start:
>>
>> > # Required-Stop:   $network $remote_fs mysql
>>
>> > # X-UnitedLinux-Should-Stop:
>>
>> > # Default-Start:       3 5
>>
>> > # Default-Stop:       0 1 2 6
>>
>> > # Description:         Apache-Tomcat Servlet Container
>>
>> > ### END INIT INFO
>>
>> > JAVA_HOME=/usr/lib/jvm/java
>>
>> > CATALINA_HOME=/usr/share/tomcat5
>>
>> > DAEMON_HOME=/usr/share/tomcat5
>>
>> > TOMCAT_USER=tomcat
>>
>> >
>>
>> > TMP_DIR=/var/tmp
>>
>> > PID_FILE=/var/run/jsvc.pid
>>
>> > CATALINA_TMPDIR=/usr/share/tomcat5/temp
>>
>> > CATALINA_OPTS="-Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed"
>>
>> > CLASSPATH=\
>>
>> > $JAVA_HOME/lib/tools.jar:\
>>
>> > $CATALINA_HOME/bin/commons-daemon.jar:\
>>
>> > $CATALINA_HOME/bin/bootstrap.jar
>>
>> > JSVC_BIN=$DAEMON_HOME/bin/jsvc
>>
>> >
>>
>> > . /etc/rc.status
>>
>> > rs_reset
>>
>> >
>>
>> > if [! -x $JSVC_BIN} ]; then
>>
>> >     echo -n >$2 "Cannot run Tomcat, ${JSVC_BIN}  not present. "
>>
>> >     rc_status -s
>>
>> >     exit 5
>>
>> > fi
>>
>> >
>>
>> > case "$1" in
>>
>> >     start)
>>
>> >     #
>>
>> >     # Start Tomcat
>>
>> >     echo -n "Starting service Tomcat 5.0.28 Servlet Container "
>>
>> >     checkproc -p ${PID_FILE} ${JSVC_BIN}
>>
>> >    case $? in
>>
>> >         0) echo -n " - Warning:  daemon already running. ";;
>>
>> >         1) echo -n " - Warning: ${PID_FILE} exists.  ";;
>>
>> >     esac
>>
>> >     $DAEMON_HOME/bin/jsvc \
>>
>> >     -user $TOMCAT_USER \
>>
>> >     -home $JAVA_HOME \
>>
>> >     -Dcatalina.home=$CATALINA_HOME \
>>
>> >     -Dcatalina.tmpdir=$CATALINA_TMPDIR \
>>
>> >     -Djava.io.tmpdir=$TMP_DIR \
>>
>> >     -wait 10 \
>>
>> >     -pidfile $PID_FILE \
>>
>> >     -outfile $CATALINA_HOME/logs/catalina.out \
>>
>> >     -errfile '&1' \
>>
>> >     $CATALINA_OPTS \
>>
>> >       -Xms64M -Xmx128M \
>>
>> >     -cp $CLASSPATH \
>>
>> >     org.apache.catalina.startup.Bootstrap \
>>
>> >     chown -R -H --dreference tomcat:tomcat $CATALINA_HOME/*
>>
>> >     rc_status -v
>>
>> >     ;;
>>
>> >
>>
>> >   stop)
>>
>> >     # Stop Tomcat
>>
>> >     echo -n "Stopping service Tomcat 5.0.28 Servlet Container "
>>
>> >     $DAEMON_HOME/bin/jsvc \
>>
>> >     -stop \
>>
>> >     -pidfile $PID_FILE \
>>
>> >     org.apache.catalina.startup.Bootstrap
>>
>> >     rc_status -v
>>
>> >     ;;
>>
>> >
>>
>> >   restart|reload|force-reload)
>>
>> >     $0 stop
>>
>> >     $0 start
>>
>> >     ;;
>>
>> >
>>
>> >   status)
>>
>> >       echo -n "Checing status of Tomcat 5.0.28 Servlet Container "
>>
>> >       checkproc -p ${PID_FILE} ${JSVC_BIN}
>>
>> >       rc_status -v
>>
>> >   *)
>>
>> >       echo "Usage: $0 {start|stop|restart|reload|force-reload|status}"
>>
>> >       exit 1;;
>>
>> > esac
>>
>> > rc_exit
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> > >
>>
>> > >
>>
>> > > ---------------------------------------------------------------------
>>
>> > > To start a new topic, e-mail: users@tomcat.apache.org
>>
>> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>
>> > > For additional commands, e-mail: users-help@tomcat.apache.org
>>
>> > >
>>
>> > >
>>
>> >
>>
>> >
>>
>> > ---------------------------------------------------------------------
>>
>> > To start a new topic, e-mail: users@tomcat.apache.org
>>
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>>
>> >
>>
>> >
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>>
>> To start a new topic, e-mail: users@tomcat.apache.org
>>
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


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


Mime
View raw message