1、在/home/bea/startBeaAll目录内创建一个startBeaAll.sh文件,加入如下内容(把相应目录与命令修改即可,红字部分为修改地方):

#!/bin/sh

echo "======weblogic start begin========"

echo "======managerServer start begin========"

managerid=`ps auxww|grep managerServer|grep -v grep|awk '{print $2}'`

if [ -n "$managerid" ];

then

echo "======managerServer is start ,to kill the managerServer managerid $managerid========"

kill -9 $managerid

sleep 10

echo "====== the weblogic managerServer start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startWebLogic.sh > /home/bea/logs/manager.log &

#/home/bea/logs/manager.log &为日志存放位置,下同

else

echo "======managerServer is not start, the weblogic managerServer start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startWebLogic.sh > /home/bea/logs/manager.log &

fi

sleep 30

echo "======managerServer start end========"

echo "======appServer1 start begin========"

apponeid=`ps auxww|grep appServer1|grep -v grep|awk '{print $2}'`

if [ -n "$apponeid" ]; then

echo "======appServer1 is start ,to kill the appServer1 apponeid $apponeid========"

kill -9 $apponeid

sleep 5

echo "====== the weblogic appServer1 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer1 http://192.168.100.102:7001 > /home/bea/logs/app1.log &

else

echo "======appServer1 is not start, the weblogic appServer1 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer1 http://192.168.100.102:7001 > /home/bea/logs/app1.log &

fi

sleep 120

echo "======appServer1 start end========"

echo "======appServer2 start begin========"

apptwoid=`ps auxww|grep appServer2|grep -v grep|awk '{print $2}'`

if [ -n "$apptwoid" ]; then

echo "======appServer2 is start ,to kill the appServer2 apptwoid $apptwoid========"

kill -9 $apptwoid

sleep 5

echo "====== the weblogic appServer2 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer2 http://192.168.100.102:7001 > /home/bea/logs/app2.log &

else

echo "======appServer2 is not start, the weblogic appServer2 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer2 http://192.168.100.102:7001 > /home/bea/logs/app2.log &

fi

sleep 120

echo "======appServer2 start end========"

echo "======appServer3 start begin========"

appthrd=`ps auxww|grep appServer3|grep -v grep|awk '{print $2}'`

if [ -n "$appthrid" ]; then

echo "======appServer3 is start ,to kill the appServer3 appthrid $appthrid========"

kill -9 $appthrid

sleep 5

echo "====== the weblogic appServer3 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer3 http://192.168.100.102:7001 > /home/bea/logs/app3.log &

else

echo "======appServer3 is not start, the weblogic appServer3 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer3 http://192.168.100.102:7001 > /home/bea/logs/app3.log &

fi

sleep 120

echo "======appServer3 start end========"

echo "======appServer4 start begin========"

appforid=`ps auxww|grep appServer4|grep -v grep|awk '{print $2}'`

if [ -n "$appforid" ]; then

echo "======appServer4 is start ,to kill the appServer4 appforid $appforid========"

kill -9 $appforid

sleep 5

echo "====== the weblogic appServer4 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer4 http://192.168.100.102:7001 > /home/bea/logs/app4.log &

else

echo "======appServer4 is not start, the weblogic appServer4 start========"

cd /home/bea/user_projects/domains/managerdomain/bin

nohup ./startManagedWebLogic.sh appServer4 http://192.168.100.102:7001 > /home/bea/logs/app4.log &

fi

sleep 120

echo "======appServer4 start end========"

sleep 5

echo "======weblogic start end========"

2、修改/etc/rc.local配置文件
  在/etc/rc.local中加入如下内容: #vi /etc/rc.local

  su - root -c "/home/bea/startBeaAll/startBeaAll.sh start "

weblogic开机启动脚本的更多相关文章

  1. 关于Ubuntu运行级别、开机启动脚本的说明

    关于Ubuntu运行级别.开机启动脚本的说明 目录简介 1.1介绍Ubuntu下面的自启动脚本目录 1.2 Linux操作系统运行级别的概念 1.3关于操作系统自启脚本的启动顺序 1.4    Lin ...

  2. linux 的开机启动脚本顺序

    linux 开机启动脚本顺序 linux 开机启动脚本顺序. 第一步:启动内核 第二步:执行init (配置文件/etc/inittab) 第三步:启动相应的脚本,并且打开终端/etc/init.d  ...

  3. Centos 配置开机启动脚本启动 docker 容器

    Centos 配置开机启动脚本启动 docker 容器 Intro 我们的 Centos 服务器上部署了好多个 docker 容器,因故重启的时候就会导致还得手动去手动重启这些 docker 容器,为 ...

  4. ubuntu-18.04 设置开机启动脚本-亲测有效

    ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 2.将下列内容复制进rc-local.servi ...

  5. ubuntu-18.04 设置开机启动脚本

    ubuntu-18.04 设置开机启动脚本 参阅下列链接 https://askubuntu.com/questions/886620/how-can-i-execute-command-on-sta ...

  6. Ubuntu 18.04 设置开机启动脚本 rc.local systemd

    ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.l ...

  7. Ubuntu 16.04设置开机启动脚本的方法

    需求:公司卡片机容量太小,只有100G,由于使用的人比较的多,开机使用后有时候就会出现磁盘空间占满数据写不进去的情况,影响工作进度,而且每次使用完都得关掉卡片机,所以就有必要写个清理磁盘的脚本,当卡片 ...

  8. ubuntu高版本如何设置开机启动脚本

    ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本 可以通过下列简单设置后,可以使rc.local重新发挥作用. 1.建立rc-local.service文件 ...

  9. 为 Android 8.0 添加开机启动脚本【转】

    本文转载自:https://zhuanlan.zhihu.com/p/32868074 本人对于 SELinux for Android 理解不深,下文中的各文件及安全规则虽都是我所编写,但也是一边查 ...

随机推荐

  1. S2SH简单介绍和理解

    struts2简介 Struts2是由WebWork基础上发展起来的,与struts1比较,选用struts2的理由是:①Struts1要求Action类继承一个抽象基类,而Struts2Action ...

  2. Sherlock and GCD

    1 import fractions, functools, sys if __name__ == '__main__': T = int(sys.stdin.readline()) for _ in ...

  3. 网上查了点关于windows注册表的知识,发现基本名词没理解好,于是整理这篇笔记(可能个别地方不准确,先这么理解吧),有了这个理解,再去看网上的文章,就差不读了

    打开注册表编辑器,左边窗格中显示的是“注册表项”,右边窗格中显示的是“注册表项的项值” 子项:子项是相对父项而言的,在某一个项(父项)下面出现的项(子项) 值项:一个项可以有一个或多个项值,当前被使用 ...

  4. 什么是REST架构 - z

    什么是REST架构 - z   REST架构风格是全新的针对Web应用的开发风格,是当今世界最成功的互联网超媒体分布式系统架构,它使得人们真正理解了Http协议本来面貌.随着 REST架构成为主流技术 ...

  5. C语言实现OOP 版本3 :简化代码

    我倒是不追求代码和C++相似,但是应该追求简洁的代码,下面是一个新的尝试 shape.h #ifndef SHAPE_H #define SHAPE_H typedef struct shape_t ...

  6. hex格式介绍及转bin格式的源程序

    Intel HEX文件是记录文本行的ASCII文本文件,在Intel HEX文件中,每一行是一个HEX记录,由十六进制数组成的机器码或者数据常量.Intel HEX文件经常被用于将程序或数据传输存储到 ...

  7. Power on & RESET 之前?

    這是個有趣的問題 ? 當應用系統 或 ic元件模組於初始之前存在的現像為何 是個得住意的問題 ! 因為得考量 是否會對週邊或被控制端造成危害 這也是長常常會是不穩定設計 的原因!得有實務經驗及想像力才 ...

  8. 一些80C51单片机支持双DPTR,C编译器是如何使用它的?

    在C51中,C编译器并不利用双DPTR来优化用户所写的程序,只有一些库例程使用了双数据指针.当在两个存储器块之间进行数据复制或比较时,以下库例程会使用双数据指针: memmovememcpymemcm ...

  9. c++ 07

    一.多重继承 1)子类同时拥有两个或两个以上的基类,同时继承了所有基类的属性和行为. 销售员    经理       \  /     销售经理 汽车 客用特性 商用特性    \    |    / ...

  10. HDU 5424 Rikka with Graph II

    题目大意: 在 N 个点 N 条边组成的图中判断是否存在汉密尔顿路径. 思路:忽略重边与自回路,先判断是否连通,否则输出"NO",DFS搜索是否存在汉密尔顿路径. #include ...