I sent this out a little over a month ago...I hope it helps.
Mike

-----Original Message-----
From: Mike Savage 
Sent: Monday, July 01, 2002 1:28 AM
To: '[EMAIL PROTECTED]'
Subject: RE: jboss in init.d


The following is an example script for a RedHat (SystemV-like) system.

First, in /etc/rc.d/init.d/JBossTomcat I have:
----------------------------------------------------------
#!/bin/sh
#
# Startup script for JBOSS, the J2EE App Server
#
# chkconfig: 2345 85 15
# description: Jboss, J2EE App Server
# processname: jboss
# pidfile: /var/run/jboss.pid
# config: ${JBOSS_HOME}/conf/tomcat/jboss.conf
# logfile: ${JBOSS_HOME}/log/server.log
#
#

# Source function library.
. /etc/rc.d/init.d/functions

APPSRV_HOME=/usr/local/appserv; export APPSRV_HOME
JAVA_HOME=$APPSRV_HOME/java; export JAVA_HOME
JAXP_HOME=/usr/local/jaxp-1.1; export JAXP_HOME
JBOSS_HOME=$APPSRV_HOME/jboss_2.4.3; export JBOSS_HOME
JBOSS_DIST=$APPSRV_HOME/jboss_2.4.3; export JBOSS_DIST
PATH=/usr/local/openssl/bin:$PATH; export PATH
PATH=/usr/local/bin:$JAVA_HOME/bin:$PATH; export PATH
RETVAL=0

# See how we were called.
case "$1" in
  start)
 cd $JBOSS_HOME/bin
        echo -n "Starting jboss daemon: "
        daemon $JBOSS_HOME/bin/JBoss-TomcatD.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 4
 $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac
exit $RETVAL
-------------------------------------------------------------

Then, the script that is called during the start process,
$JBOSS_HOME/bin/JBoss-TomcatD.sh contains:

-------------------------------------------------------------
#!/bin/sh

# Minimal script to get JBoss started.

JBOSS_CLASSPATH=$JBOSS_CLASSPATH:run.jar

# Add all login modules for JAAS-based security
# and all libraries that are used by them here
JBOSS_CLASSPATH=$JBOSS_CLASSPATH

# Check for SUN(tm) JVM w/ HotSpot support
#
HOTSPOT=`java -version 2>&1 | grep HotSpot`"x"
if [ "$HOTSPOT" != "x" ]; then
       HOTSPOT="-server"
else
       HOTSPOT=""
fi

# Add the XML parser jars and set the JAXP factory names
# Xerces parser JAXP setup(default)
JBOSS_CLASSPATH=$JBOSS_CLASSPATH:../lib/ext/xerces.jar:../lib/ext/xalan.jar
JBOSS_CLASSPATH=$JBOSS_CLASSPATH:$JAVA_HOME/lib/tools.jar
JAXP=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.Docum
entBuilderFactoryImpl
JAXP="$JAXP
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactory
Impl"

if [ "$1" = "start" ] ; then
  shift
java $HOTSPOT $JAXP -classpath $JBOSS_CLASSPATH org.jboss.Main tomcat $@ >
/dev/null 2>&1 &
  echo $! > /var/run/jboss.pid

elif [ "$1" = "stop" ] ; then
  shift
  kill -15 `cat /var/run/jboss.pid`
  rm -f /var/run/jboss.pid

elif [ "$1" = "run" ] ; then
  shift
echo JBOSS_CLASSPATH=$JBOSS_CLASSPATH
java $HOTSPOT $JAXP -classpath $JBOSS_CLASSPATH org.jboss.Main tomcat $@

else
  echo "Usage:"
  echo $0" (start|run|stop)"
  echo "        start - start jboss in the background"
  echo "        run   - start jboss in the foreground"
  echo "        stop  - stop jboss"

  exit 0
fi
-----------------------------------------------------------
These scripts launch a JBoss/Tomcat combined environment.
In the java command lines in the second script, the part of
these commands that show tomcat, means use the conf file under
$JBOSS_HOME/conf/tomcat when starting.  To use the conf files
under $JBOSS_HOME/conf/default, simply remove tomcat from the
command line, like this:

java $HOTSPOT $JAXP -classpath $JBOSS_CLASSPATH org.jboss.Main $@ >
/dev/null 2>&1 &

Maybe kind of crude, but they work for me.
Hope that helps.

Mike

---Original Message---
Date: Fri, 28 Jun 2002 14:00:10 -0400
From: Vincent Stoessel <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [JBoss-user] jboss in init.d
Reply-To: [EMAIL PROTECTED]

Anyone have a usable jboss init.d
script for starting Jboss at boot time in linux?
Thanks.
-- 
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to