⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jboss_init_redhat.sh

📁 《J2EE企业级应用开发》一书的配套源代码
💻 SH
字号:
#!/bin/sh## JBoss Control Script## chkconfig: 3 80 20# description: JBoss EJB Container# # To use this script# run it as root - it will switch to the specified user# It loses all console output - use the log.## 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 ## 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#define where jboss is - this is the directory containing directories log, bin, conf etcJBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}#make java is on your pathJAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}#define the classpath for the shutdown classJBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar"}#define the script to use to start jbossJBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh"}if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then  # ensure the file exists  touch $JBOSS_CONSOLEfiif [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then  echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"  echo "WARNING: ignoring it and using /dev/null"  JBOSS_CONSOLE="/dev/null"fi#define what will be done with the console logJBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}#define the user under which jboss will run, or use RUNASIS to run as the current userJBOSSUS=${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 "fiif [ -z "`echo $PATH | grep $JAVAPTH`" ]; then  export PATH=$PATH:$JAVAPTHfiif [ ! -d "$JBOSS_HOME" ]; then  echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME  exit 1fiecho CMD_START = $CMD_STARTcase "$1" instart)    cd $JBOSS_HOME/bin    if [ -z "$SUBIT" ]; then        eval $CMD_START >${JBOSS_CONSOLE} 2>&1 &    else        $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &"     fi    ;;stop)    if [ -z "$SUBIT" ]; then        $CMD_STOP    else        $SUBIT "$CMD_STOP"    fi     ;;restart)    $0 stop    $0 start    ;;*)    echo "usage: $0 (start|stop|restart|help)"esac

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -