#!/bin/bash
JAVA_HOME=/usr/local/jdk
export JAVA_HOME

RESIN_HOME=/usr/local/resin
export RESIN_HOME

# location of perl executable
#

args=
#
# class to start
#
class=com.caucho.server.resin.Resin
#
# name of the server
#
name="httpd"

perl=/usr/bin/perl

#
# On Linux, you may want to reduce the stack size per thread to allow
# for more threads.  The default 8192k stack per thread gives 255 threads.
# Changing it to 2048k per thread gives 1023 threads
#
# ulimit -s 2048
#
# trace script and simlinks to find thw wrapper
#
script=`/bin/ls -l $0 | awk '{ print $NF; }'`

while test -h "$script"
do
  script=`/bin/ls -l $script | awk '{ print $NF; }'`
done

exec $perl /usr/local/resin/bin/wrapper.pl -chdir -name "$name" -class "$class" $args  $*

