User: kimptoc 
  Date: 01/07/07 08:21:47

  Modified:    src/bin  jboss_init_redhat.sh run.sh
  Log:
  added ability to run jboss as current user to init script and use of JBOSS_HOME in 
run.sh - if set
  
  Revision  Changes    Path
  1.2       +32 -3     jboss/src/bin/jboss_init_redhat.sh
  
  Index: jboss_init_redhat.sh
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/bin/jboss_init_redhat.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jboss_init_redhat.sh      2001/07/01 21:01:27     1.1
  +++ jboss_init_redhat.sh      2001/07/07 15:21:47     1.2
  @@ -22,14 +22,30 @@
   
   # [ #420297 ] JBoss startup/shutdown for RedHat
   
  -
  +#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
   JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}
   
  +#define the classpath for the shutdown class
   JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/lib/ext/jboss.jar"}
  +
  +#define the script to use to start jboss
   JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh"}
  +
  +#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"
  +
  +if [ "$JBOSSUS" = "RUNASIS" ]; then
  +  SUBIT=""
  +else
  +  SUBIT="su - $JBOSSUS -c "
  +fi
  +
   if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
     export PATH=$PATH:$JAVAPTH
   fi
  @@ -39,12 +55,25 @@
     exit 1
   fi
   
  +
  +echo CMD_START = $CMD_START
  +
  +
   case "$1" in
   start)
  -    su - $JBOSSUS -c "cd $JBOSS_HOME/bin; $JBOSSSH >/dev/null 2>&1 &"
  +    cd $JBOSS_HOME/bin
  +    if [ -z "$SUBIT" ]; then
  +        eval $CMD_START >/tmp/jboss.log 2>&1 &
  +    else
  +        $SUBIT "$CMD_START >/dev/null 2>&1 &" 
  +    fi
       ;;
   stop)
  -    su - $JBOSSUS -c "java -classpath $JBOSSCP org.jboss.Shutdown"
  +    if [ -z "$SUBIT" ]; then
  +        $CMD_STOP
  +    else
  +        $SUBIT "$CMD_STOP"
  +    fi 
       ;;
   restart)
       $0 stop
  
  
  
  1.20      +8 -0      jboss/src/bin/run.sh
  
  Index: run.sh
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/bin/run.sh,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- run.sh    2001/05/30 16:37:09     1.19
  +++ run.sh    2001/07/07 15:21:47     1.20
  @@ -2,6 +2,14 @@
   
   # Minimal jar file to get JBoss started.
   
  +#assumed that this script will start in the bin directory
  +
  +#but just in case use JBOSS_HOME if found
  +if [ "$JBOSS_HOME" ]; then
  +   cd $JBOSS_HOME/bin
  +   echo Using JBOSS_HOME to set current directory to $JBOSS_HOME/bin
  +fi 
  +
   JBOSS_CLASSPATH=$JBOSS_CLASSPATH:run.jar
   
   # Add all login modules for JAAS-based security
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to