zoukankan      html  css  js  c++  java
  • 自动启动WebLogic系统的服务脚本

    转至:http://blog.chinaunix.net/uid-20164485-id-1973841.html

    自动启动WebLogic系统的服务脚本
     
    2010.10.25 TsengYia#126.com http://tsengyia.blog.chinaunix.net/
     
    ***********************************************

    系统环境:RHEL5.0 [2.6.18-128xen]

    *****************************************************************
        —— Weblogic运行在product模式,手动运行或终止时需验证用户名和密码。
     
    一、创建/etc/init.d/weblogic脚本文件
    #!/bin/bash
    #
    # By TsengYia#126.com http://selinux.cublog.cn
    #
    # chkconfig: - 85 15
    # description: Startup/Stop script for the WebLogic Server
    #
    # Source function library.
    . /etc/rc.d/init.d/functions
    #
    # JDK Configuration
    JAVA_HOME=/usr/local/jdk
    CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    PATH=$PATH:$JAVA_HOME/bin
    #
    SRV_IPADD="172.20.20.1"
    WLS_USER="user_to_run_wls"
    WLS_PW="123456"
    WLS_INIT_PATH="/usr/local/weblogic/user_projects/domains/mydomain/bin"
    export JAVA_HOME CLASSPATH PATH MW_HOME WLS_USER WLS_PW
    #
    case "$1" in
    start)
        ${WLS_INIT_PATH}/startWebLogic.sh &
        ;;
    stop)
        ${WLS_INIT_PATH}/stopWebLogic.sh $WLS_USER $WLS_PW
        ;;
    status)
        if ( pgrep "java" && ps ax | grep "${SRV_IPADD}:80" ) &> /dev/null ; then
            echo "WebLogic Server is running."
            exit 0
        else
            echo "WebLogic Server is down."
            exit 1
        fi
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage:$0 start|stop|status|restart"
        ;;
    esac
     
    二、添加为weblogic系统服务
    [root@localhost ~]# chmod 750 /etc/init.d/weblogic
    [root@localhost ~]# chkconfig --add weblogic
    [root@localhost ~]# chkconfig --level 35 weblogic on
    [root@localhost ~]# /etc/init.d/weblogic start
  • 相关阅读:
    shell 学习笔记 LinuxShell脚本攻略(第2版)
    [六省联考2017]分手是祝愿
    [SDOI2010]粟粟的书架
    [CQOI2018]解锁屏幕
    [SCOI2007]最大土地面积
    CF369E Valera and Queries
    CF817F MEX Queries
    [HEOI2016/TJOI2016]求和
    [CQOI2018]九连环
    [HNOI2015]亚瑟王
  • 原文地址:https://www.cnblogs.com/my-first-blog-lgz/p/13936523.html
Copyright © 2011-2022 走看看