Here's a better one (more configurable, provides more vars at the top
and runs as whoever you specify). I would still like to hear from
someone who knows jboss better to tell me that yes, this is a safe way
to stop things. (I did just recently see a posting before mine with
someone else who does this; so I'm guessing it's okay...)
=================================
#!/bin/sh
JAVA_HOME=/usr/java/jdk1.3.1
JBOSS_HOME=/data/packages/JBoss-2.2.2_Tomcat-3.2.2/jboss
JBOSS_USER=jboss
JBOSS_HOST=localhost
JBOSS_PORT=8082
JBOSS_LOG=/tmp/jboss.log
case "$1" in
start)
DIR=`pwd`
cd $JBOSS_HOME/bin
su -c "nohup ./run_with_tomcat.sh 1> $JBOSS_LOG 2>&1 &" $JBOSS_USER
cd $DIR
;;
stop)
$JAVA_HOME/bin/java -cp $JBOSS_HOME/lib/ext/jboss.jar
org.jboss.Shutdown
$JBOSS_HOST $JBOSS_PORT
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
================================
David Ward wrote:
> I've looked through the mail archives, and it looks like people's
> previous attempts at a jboss start/stop script suitable for /etc/init.d
> are overly complex, especially since they are copying what's in the run
> scripts and if JBoss decides to change those, people's custom scripts
> have to change.
>
> So.... here's something a bit easier I threw together (only tested on
> RedHat Linux 7.1):
>
> -- snip --
>
> #!/bin/sh
>
> export JAVA_HOME=/usr/java/jdk1.3.1
> export JBOSS_HOME=/data/packages/JBoss-2.2.2_Tomcat-3.2.2/jboss
>
> case "$1" in
> start)
> DIR=`pwd`
> cd $JBOSS_HOME/bin
> nohup ./run_with_tomcat.sh 1> /tmp/jboss.log 2>&1 &
> cd $DIR
> ;;
> stop)
> $JAVA_HOME/bin/java -cp $JBOSS_HOME/lib/ext/jboss.jar
> org.jboss.Shutdown
> ;;
> *)
> echo "Usage: $0 {start|stop}"
> exit 1
> esac
>
> -- snip --
>
> The only thing I see funky happening is that I get a lot less output on
> shutdown then when I used to do a Control-C. Is this OK?
>
> Also, if you have a jboss user (or nobody user) that you'd rather this
> process run as, you might want to "su -c" (or something similar) the
> process.
>
> Hope this helps,
> David
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user