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. C语言中固定大小的数据类型的输入和输出

    在使用C语言时,对数据的大小要求比较严格时,例如要使用32位的整数类型,这时要使用 int32_t,无论平台如何变化,数据大小仍然是32位,固定位数的数据类型还有 uint32_t.uint64_t ...

  2. Hbase常见异常

    1. HBase is able to connect to ZooKeeper but the connection closes immediately hbase(main):001:0> ...

  3. javascript的全局变量

    javascipt是一门面向对象的编程语言.由于存在一些全局属性及全局函数,因此可以认为存在一个全局变量,这些全局属性及全局函数均是其属性或函数. 在js核心中,并没有定义一个具体的全局变量,因此,j ...

  4. 自定义VIew基础

    一.坐标 ①.通过View获取坐标,通过调用getLeft().getRight()...方法获取坐标. 1.获取到的是相对于View父控件的位置 2.指的是左上角和右下角的x,y值 3.View还提 ...

  5. ecshop优化修改sitemap.xml到根目录

    大家都知道sitemap.xml是用来给搜索引擎提交收录的工具,虽然搜索引擎自己也会收录网站但是有了sitemap.xml之后速度会加快不少.而ecshop程序是有自动生成sitemap.xml的功能 ...

  6. cocos2dx ——屏幕适配

    本文出自 “夏天的风” 博客,请务必保留此出处 http://shahdza.blog.51cto.com/2410787/1550089 手机的屏幕大小千差万别,如现在流行的安卓手机屏幕大部分长宽比 ...

  7. Hdu1093

    #include <stdio.h> int main() { int T,n; ; while(scanf("%d",&T)!=EOF){ while(sca ...

  8. C语言编程时常犯十八个错误

    C语言的最大特点是:功能强.使用方便灵活.C编译的程序对语法检查并不象其它高级语言那么严格,这就给编程人员留下“灵活的余地”,但还是由于这个灵活给程序的调试带来了许多不便,尤其对初学C语言的人来说,经 ...

  9. 新唐的icp和isp

    ICP 的意思是 "在电路编程"(in Circuit Programming),PC 电脑可以运行 “NuMicro ICP Programming Tool”软件通过 Nu-L ...

  10. tp28xx port pin (open-drain )and (push-pull) 和open collector)

    具有开漏(OD)输出的器件是指内部输出和地之间有个N沟道的MOSFET(T1),这些器件可以用于电平转换的应用.输出电压由Vcc'决定.Vcc'可以大于输入高电平电压VCC(up-translate) ...