Attached script derived from the launcher that comes with jboss.

On Sun, Jun 03, 2001 at 03:40:27PM -0000, Marcus Jenkins wrote:
> Hi Matt
> 
> >I now use a SysV style init script to bring up/down jboss...
> 
> Could you post it (assuming it's quite short), please?
> 
> Thanks
> 
> Marcus
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user

-- 

"A weird imagination is most useful to gain full advantage of all the features."

      matt hudson   [EMAIL PROTECTED]    http://www.spaceship.com/~matt
#!/bin/sh
#
# Startup script for JBOSS, the J2EE EJB Server
#
# /etc/init.d/jboss
#
### BEGIN INIT INFO
# Provides:          jboss
# Required-Start:    
# Required-Stop:
# Default-Start:     
# Default-Stop:
# Description:       Starts jBoss J2EE EJB Server
### END INIT INFO


. /etc/rc.status
. /etc/rc.config

base=${0##*/}
link=${base#*[SK][0-9][0-9]}

test $link = $base

rc_reset


#SET THE FOLLOWING LINE TO YOUR JAVA_HOME
export JAVA_HOME=/usr/lib/jdk1.3

#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=

cd $JBOSS_HOME/bin
JAVACMD="$JAVA_HOME/bin/java"

# Minimal jar file to get JBoss started.
CLASSPATH=$CLASSPATH:$JBOSS_HOME/bin/run.jar
#next line for jBoss_FINAL-2.0
CLASSPATH="$CLASSPATH:$JBOSS_HOME/lib/crimson.jar"
CLASSPATH="$CLASSPATH:$JBOSS_HOME/lib/jdbc2_0-stdext.jar"
CLASSPATH="$CLASSPATH:$JBOSS_HOME/lib/jboss-jaas.jar"

JBOSS_OPTS="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
JBOSS_OPTS="$JBOSS_OPTS 
-Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl"



rc_reset

# See how we were called.
case "$1" in
   start)
                echo -n "Starting jBoss daemon:"
                shift
                su nobody -- $JAVACMD $JBOSS_OPTS -classpath $CLASSPATH org.jboss.Main 
> /dev/null 2>&1 &
                echo $! > /var/run/jboss.pid
                rc_status -v
                sleep 1
                ;;
   run)
                echo -n "Stopping jboss daemon: "
                shift
                su nobody -- $JAVACMD $JBOSS_OPTS -classpath $CLASSPATH org.jboss.Main 
"$@"
                rc_status -v
                ;;
   stop)
                echo -n "Stopping jboss daemon: "
                shift
                kill -15 `cat /var/run/jboss.pid`
                rm -rf /var/run/jboss.pid
                rc_status -v
                ;;
   restart)
                echo -n "Restarting jboss daemon: "
                $0 stop
                sleep 2
                $0 start
                rc_status -v
                ;;
    *)
                echo "Usage:"
                echo "jboss (start|restart|run|stop)"
                echo "        start   - start jboss in the background"
                echo "        restart - stop, then start jboss in the background"
                echo "        run     - start jboss in the foreground"
                echo "        stop    - stop jboss"

                exit 1

esac
rc_exit

Reply via email to