On 09/09/2010 04:30, jan gestre wrote: > On Tue, Sep 7, 2010 at 3:40 PM, Pid <[email protected]> wrote: >> On 07/09/2010 06:14, jan gestre wrote: >>> On Tue, Sep 7, 2010 at 1:02 PM, Wesley Acheson <[email protected]> >>> wrote: >>>> On Tue, Sep 7, 2010 at 4:34 AM, jan gestre <[email protected]> wrote: >>>>> I'm using the latest 6.0.29 binary >>>>> distribution, and I don't have an idea where to download jsvc, if it's >>>>> already included I don't know the location, could someone please >>>>> enlighten me on how to do this. >>>>> >>>> It can be downloaded as part of this bundle >>>> http://commons.apache.org/daemon/download_daemon.cgi. Instructions are >>>> here http://commons.apache.org/daemon/jsvc.html. Dunno how to use it >>>> even after reading the instructions though. >> >> Conveniently, the binary you need is included in tomcat/bin: >> >> commons-daemon-native.tar.gz >> >> I'll assume Linux, as you didn't state explicitly which OS you're using. >> >> tar -zxvf commons-daemon-native.tar.gz >> cd commons-daemon-1.0.2-native-src >> more RELEASE-NOTES.txt >> >> cd unix >> more INSTALL.txt >> >> ... follow the instructions therein. >> >> >> p >> > > Hi Pid, > > I've followed your instructions and was able to create the executable > jsvc however I don't know the next step, should I incorporate jsvc to > tomcat's init.d script, and change server.xml respectively? If yes, > how will I do it? > Tomcat is running as an unprivilege user.
There's examples of shell scripts called Tomcat.sh, Tomcat5.sh in the
unix directory subtree, which may help. Use Tomcat5.sh as a template.
It demonstrates how to use & configure the jsvc binary.
p
> Here is my tomcat start up file and server.xml if it matters
>
> #!/bin/bash
> #
> # tomcat Starts Tomcat Java server.
> #
> #
> # chkconfig: 345 88 12
> # description: Tomcat is the server for
> # Java servlet applications.
> ### BEGIN INIT INFO
> # Provides: $tomcat
> ### END INIT INFO
>
> JAVA_HOME=/usr/java/jdk1.6.0_21
> export JAVA_HOME
> TOMCAT_HOME=/usr/src/tomcat/bin
> START_TOMCAT=/usr/src/tomcat/bin/startup.sh
> STOP_TOMCAT=/usr/src/tomcat/bin/shutdown.sh
>
> # Source function library.
> . /etc/init.d/functions
>
> [ -f $START_TOMCAT ] || exit 0
> [ -f $STOP_TOMCAT ] || exit 0
> RETVAL=0
>
> umask 077
>
> start() {
> echo -n $"Starting Tomcat Java server: "
> daemon su -c $START_TOMCAT tomcat
> echo
> return $RETVAL
> }
> stop() {
> echo -n $"Shutting down Tomcat Java server: "
> daemon su -c $STOP_TOMCAT tomcat
> echo
> return $RETVAL
> }
> restart() {
> stop
> start
> }
> case "$1" in
> start)
> start
> ;;
> stop)
> stop
> ;;
> restart|reload)
> restart
> ;;
> *)
> echo $"Usage: $0 {start|stop|restart}"
> exit 1
> esac
>
> exit $?
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature
