[jboss-cvs] jboss/src/bin ...
Dimitris Andreadis
dimitris.andreadis at jboss.com
Thu Jul 20 14:55:34 EDT 2006
User: dimitris
Date: 06/07/20 14:55:34
Modified: src/bin Tag: Branch_3_2 jboss_init_redhat.sh
Log:
JBAS-3217, add JBOSS_CONF, JBOSS_HOST variables to the script (default to 'default' & '0.0.0.0'), chown the created console.log file
Revision Changes Path
No revision
No revision
1.11.2.1 +29 -31 jboss/src/bin/jboss_init_redhat.sh
(In the diff below, changes in quantity of whitespace are not shown.)
Index: jboss_init_redhat.sh
===================================================================
RCS file: /cvsroot/jboss/jboss/src/bin/jboss_init_redhat.sh,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -b -r1.11 -r1.11.2.1
--- jboss_init_redhat.sh 14 Jun 2002 06:40:06 -0000 1.11
+++ jboss_init_redhat.sh 20 Jul 2006 18:55:34 -0000 1.11.2.1
@@ -1,42 +1,52 @@
#!/bin/sh
#
-# JBoss Control Script
+# $Id: jboss_init_redhat.sh,v 1.11.2.1 2006/07/20 18:55:34 dimitris Exp $
#
-# chkconfig: 3 80 20
-# description: JBoss EJB Container
+# JBoss Control Script
#
-# To use this script
-# run it as root - it will switch to the specified user
-# It loses all console output - use the log.
+# To use this script run it as root - it will switch to the specified user
#
-# Here is a little (and extremely primitive)
-# startup/shutdown script for RedHat systems. It assumes
-# that JBoss lives in /usr/local/jboss, it's run by user
-# 'jboss' and JDK binaries are in /usr/local/jdk/bin. All
-# this can be changed in the script itself.
-# Bojan
+# Here is a little (and extremely primitive) startup/shutdown script
+# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
+# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
+# All this can be changed in the script itself.
#
-# Either amend this script for your requirements
-# or just ensure that the following variables are set correctly
-# before calling the script
-
-# [ #420297 ] JBoss startup/shutdown for RedHat
+# Either modify this script for your requirements or just ensure that
+# the following variables are set correctly before calling the script.
#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}
-#make java is on your path
+#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
+JBOSS_USER=${JBOSS_USER:-"jboss"}
+
+#make sure java is in your path
JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}
+#configuration to use, usually one of 'minimal', 'default', 'all'
+JBOSS_CONF=${JBOSS_CONF:-"default"}
+
+#bind address for jboss services, by default bind to *all* NICs
+JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}
+
#define the classpath for the shutdown class
JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}
#define the script to use to start jboss
-JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c all"}
+JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_HOST"}
+
+if [ "$JBOSS_USER" = "RUNASIS" ]; then
+ SUBIT=""
+else
+ SUBIT="su - $JBOSS_USER -c "
+fi
if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
# ensure the file exists
touch $JBOSS_CONSOLE
+ if [ ! -z "$SUBIT" ]; then
+ chown $JBOSS_USER $JBOSS_CONSOLE
+ fi
fi
if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
@@ -48,18 +58,9 @@
#define what will be done with the console log
JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}
-#define the user under which jboss will run, or use RUNASIS to run as the current user
-JBOSSUS=${JBOSSUS:-"jboss"}
-
CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
CMD_STOP="java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"
-if [ "$JBOSSUS" = "RUNASIS" ]; then
- SUBIT=""
-else
- SUBIT="su - $JBOSSUS -c "
-fi
-
if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
export PATH=$PATH:$JAVAPTH
fi
@@ -69,10 +70,8 @@
exit 1
fi
-
echo CMD_START = $CMD_START
-
case "$1" in
start)
cd $JBOSS_HOME/bin
@@ -97,4 +96,3 @@
echo "usage: $0 (start|stop|restart|help)"
esac
-
More information about the jboss-cvs-commits
mailing list