Yep, looks pretty handy to me.  While you're asking for timestamped logs, how
about log rotation, as well?  I've been meaning to write it for a while,
haven't quite got there...

Tom

On Tue, 13 Feb 2001, you wrote:
> Greetings,
> 
> Here is another version of the Linux jboss init script.
> Thanks to Michael Drew, Toby Allsopp, and Tom Cook for their help.
> 
> If this seems okay, I'll send it on to the jboss-dev list.
> 
> 1. First some suggested options to run.sh.
> I have left all logging to jboss, though I am a bit
> frustrated that the jboss log is not time-stamped. I'll
> add this as a wish-list when I post to jboss-dev.
> 
> 2. Second a jboss init script.
> 
> There are some differences between how jboss will run as a service,
> and how jboss will run when started from a user's shell due to the
> way jboss loads its classpath. When started from a shell it first adds
> "run.jar" to the users $CLASSPATH. When started as a service this classpath
> 
> will be empty. I have put a reminder in the init script to add special
> classpath
> information should it be needed.
> 
> 
> Thus, for "run.sh" , ommitting most details, including the jetty and tomcat
> 
> options,
> I suggest something along the following lines, where the user can choose to
> run
> in the foreground or background.
> 
> #######################################################
> #!/bin/sh
> #
> ...
> ## Shell script to start and stop the server
> ...
> iif [ "$JAVACMD" = "" ] ; then
>     if [ -d ${JAVA_HOME}/lib/i386 ] ; then
>    # We are probably in a SUN/Balckdown environment ...
>    JAVACMD="$JAVA_HOME/bin/java -server"
>     else
>    # it is probably Big Blue ...
>    JAVACMD=$JAVA_HOME/bin/java
>     fi
> fi
> 
> if [ "$1" = "start" ] ; then
>   shift
>   $JAVACMD $JBOSS_OPTS -classpath $CLASSPATH org.jboss.Main "$@" >
> /dev/null 2>&1 &
>   echo $! > /var/run/jboss.pid
> 
> elif [ "$1" = "stop" ] ; then
>   shift
>   kill -15 `cat /var/run/jboss.pid`
> 
> elif [ "$1" = "run" ] ; then
>   shift
>   $JAVACMD $JBOSS_OPTS -classpath $CLASSPATH   org.jboss.Main "$@"
> 
> else
>   echo "Usage:"
>   echo "jboss (start|run|stop)"
>   echo "        start - start jboss in the background"
>   echo "        run   - start jboss in the foreground"
>   echo "        stop  - stop jboss"
> 
>   exit 0
> fi
> 
> ##################################################
> 
> #!/bin/sh
> #
> # Startup script for JBOSS, the J2EE EJB Server
> #
> # chkconfig: 2345 85 15
> # description: Jboss is an EJB Server
> # processname: jboss
> # pidfile: /var/run/jboss.pid
> # config: ${JBOSS_HOME}/conf/default/jboss.conf
> # logfile: ${JBOSS_HOME}/log/server.log
> #
> #
> # version 1.2 -
> #
> 
> # Source function library.
> . /etc/rc.d/init.d/functions
> 
> #SET THE FOLLOWING LINE TO YOUR JAVA_HOME !
> export JAVA_HOME=/opt/jdk
> #export JAVA_HOME=/usr/java/jdk1.3  #SUN's rpm
> #export JAVA_HOME=/opt/IBMJava2-13  #IBM's rpm
> 
> #SET THE FOLLOWING LINE TO YOUR CORRECT JBOSS_HOME !
> export JBOSS_HOME=/usr/local/jboss
> 
> export PATH=$PATH:$JBOSS_HOME/bin:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
> 
> #IF YOU NEED SPECIAL CLASSES IN YOUR CLASSPATH
> #AT STARTUP, ADD THEM TO YOUR CLASSPATH HERE
> #export CLASSPATH=
> 
> RETVAL=0
> 
> # See how we were called.
> case "$1" in
>   start)
>  cd $JBOSS_HOME/bin
>         echo -n "Starting jboss daemon: "
>         daemon $JBOSS_HOME/bin/run.sh start
>         RETVAL=$?
>         echo
>        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/jboss
>         ;;
>   stop)
>         echo -n "Stopping jboss daemon: "
>         killproc jboss
>         RETVAL=$?
>         echo
>         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/jboss
>         ;;
>   restart)
>         echo -n "Restarting jboss daemon: "
>  $0 stop
>  sleep 2
>  $0 start
>         ;;
> 
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to