----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hi,

I have just finished 2 little scripts, which enable the manual start of
ApacheJServ. I think, as I searched long enough for such a script, many are
interested in that so I am posting it.

I have made this script with my 1 year experience in linux, so if anyone
think's there is something to be made better, I would be very grateful for
your response. The scripts are made whith and for SuSe Linux and it's
startup-directory (/sbin/init.d/), but surely can be easily used on other
linux/unix-platforms.

The first of the scripts (jserv) is just for starting the second one by the
arguments 'start' and 'stop'. In the script you define which user starts
JServ and the position of the starting script.

The second script (jserv.script) actually starts the virtual machine and the
JServ-Environment. Don't forget, you have to define the virtual machine
startup-parameters, even if they are already noted in the 'jserv.properties'
(the values there that start with "wrapper" only apply for the automatic
start of JServ). I have noted all parameters and their
'jserv-properties'-correspondence, that was important for me - so maybe you
have to do some changes there.

The script was written ans tested with SuSe Linux 6.3, apache 1.3.9,
JServ1.1, jdk1.2.2, JSDK2.0 on IBM PC i686.

Hope, I could help somebody whith that,
Roland Becker.


---------------------------------------------------/sbin/init.d/jserv:

#!/bin/sh

# Apache-JServ-Starting-Script

# Created by Roland Becker, 2000
# No Guarantees!

# Give the username for exection
JSERVUSER=becker

# Give the position of the jserv-script, that is
# making the startup
JSERVSCRIPT=/usr/bin/jserv1.script

mode=$1

case "$mode" in
  'start')
    # Start JServ

    if test -x $JSERVSCRIPT
    then
      nohup $JSERVSCRIPT start $JSERVUSER&
    else
      echo "Can't execute $JAVABIN"
    fi
    ;;

  'stop')
    # Stop JServ
      nohup $JSERVSCRIPT stop $JSERVUSER -s&
    ;;

  *)
    # usage
    echo "usage: $0 start|stop"
    exit 1
    ;;
esac

---------------------------------------------------
/usr/bin/jserv.script:

#!/bin/sh

# Apache-JServ-Starting-Script
# 2nd Stage of starting of ApacheJServ - the actual starting...

# Created by Roland Becker, 2000
# No Guarantees!

# Give path an name of the java executable;
# parameter 'wrapper.bin' in 'jserv.properties'
JAVABIN=/usr/lib/jdk1.2.2/bin/java

# Give additional parameters for the Java interpreter
# such as '-Xms20M'
# parameter 'wrapper.parameters' in 'jserv.properties'
JAVABINPARAMETERS=-Xms20m\ -Xmx20m

# Give, colon-separated, all classpaths for the virtual machine
# all 'wrapper.classpath'-entries in 'jserv.properties'
JSERVCLASSPATH=/usr/local/apache2/jserv/libexec/ApacheJServ.jar:/usr/lib/JSD
K2.0/lib/jsdk.jar:/usr/lib/:/usr/lib/mm.mysql.jdbc-2.0pre4

# Give the position of the 'jserv.properties'-file to
# use for this virtual machine
JSERVPROPERTIES=/usr/local/apache2/jserv/etc/jserv.properties

mode=$1

case "$mode" in
  'start')
      $JAVABIN -classpath $JSERVCLASSPATH $JAVABINPARAMETERS
org.apache.jserv.JServ $JSERVPROPERTIES&
    ;;

  'stop')
    # Stop JServ
      $JAVABIN -classpath $JSERVCLASSPATH $JAVABINPARAMETERS
org.apache.jserv.JServ $JSERVPROPERTIES -s&
    ;;
esac




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to