weblogic开机启动脚本
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开机启动脚本的更多相关文章
- 关于Ubuntu运行级别、开机启动脚本的说明
关于Ubuntu运行级别.开机启动脚本的说明 目录简介 1.1介绍Ubuntu下面的自启动脚本目录 1.2 Linux操作系统运行级别的概念 1.3关于操作系统自启脚本的启动顺序 1.4 Lin ...
- linux 的开机启动脚本顺序
linux 开机启动脚本顺序 linux 开机启动脚本顺序. 第一步:启动内核 第二步:执行init (配置文件/etc/inittab) 第三步:启动相应的脚本,并且打开终端/etc/init.d ...
- Centos 配置开机启动脚本启动 docker 容器
Centos 配置开机启动脚本启动 docker 容器 Intro 我们的 Centos 服务器上部署了好多个 docker 容器,因故重启的时候就会导致还得手动去手动重启这些 docker 容器,为 ...
- ubuntu-18.04 设置开机启动脚本-亲测有效
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 2.将下列内容复制进rc-local.servi ...
- ubuntu-18.04 设置开机启动脚本
ubuntu-18.04 设置开机启动脚本 参阅下列链接 https://askubuntu.com/questions/886620/how-can-i-execute-command-on-sta ...
- Ubuntu 18.04 设置开机启动脚本 rc.local systemd
ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.l ...
- Ubuntu 16.04设置开机启动脚本的方法
需求:公司卡片机容量太小,只有100G,由于使用的人比较的多,开机使用后有时候就会出现磁盘空间占满数据写不进去的情况,影响工作进度,而且每次使用完都得关掉卡片机,所以就有必要写个清理磁盘的脚本,当卡片 ...
- ubuntu高版本如何设置开机启动脚本
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本 可以通过下列简单设置后,可以使rc.local重新发挥作用. 1.建立rc-local.service文件 ...
- 为 Android 8.0 添加开机启动脚本【转】
本文转载自:https://zhuanlan.zhihu.com/p/32868074 本人对于 SELinux for Android 理解不深,下文中的各文件及安全规则虽都是我所编写,但也是一边查 ...
随机推荐
- C#调用进程
Process process = new Process(); process.StartInfo.FileName = "123.exe"; process.StartInfo ...
- CSSOM视图模式
相关技术文章: CSSOM视图模式(CSSOM View Module)相关整理 W3C CSSOM View Module
- No1_7.类和对象_Java学习笔记
一.面向对象的特点:a.封装:封装是面向对象的核心思想,将对象的属性和行为封装起来的载体就是类,类通常对客户隐藏其实现细节,这就是封装的思想: 保证了类内部数据的完整性,应用该类的用户不能轻易直接操纵 ...
- 在mac中导入hadoop2.6.0源代码至eclipse
一.环境准备 1.安装jdk.maven等 2.下载hadoop源代码,并解压 3.将tools.jar复制到Classes中,具体原因见http://wiki.apache.org/hadoop/H ...
- uva1368 DNA Consensus String
<tex2html_verbatim_mark> Figure 1. DNA (Deoxyribonucleic Acid) is the molecule which contains ...
- Android设置选项开发及自定义Preference样式
一个完整的Android应用程序都应该提供选项(或者叫偏好设置等等)让用户对APP的表现形式能够进行设置,比如说是否加入用户体验计划,或者是否自动升级.定时提醒.开启自启动.后台运行等等.提供一个好的 ...
- Django的 select_related 和 prefetch_related 函数对 QuerySet 查询的优化(三)
4.一些实例 如果我们想要获得所有家乡是湖北的人,最无脑的做法是先获得湖北省,再获得湖北的所有城市,最后获得故乡是这个城市的人.就像这样: 1 2 3 4 5 >>> hb = Pr ...
- form 表单练习
创建战网通行证账号,开启您的冒险之旅.<form> <table border="0"> <tr> & ...
- try...catch...finally中try块发生的事件顺序
1.try块在发生异常的地方中断程序的执行.2.如果有catch块,就检查该块是否匹配已抛出的异常类型.如果没有catch块,就执行finally块(如果没有catch块,就一定要有finally块) ...
- centos下安装mysql步骤
转载自http://zym820910.iteye.com/blog/671566 一.下载MySQL5.0和相关perl包 1.官网[url] http://dev.mysql.com/downlo ...