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#读取USB的一些相关信息
在USB\VID_05A9&PID_2800\5&1BFE1C47&0&8里面,USB代表设备类型,5&1BFE1C47&0&8代表设备连接位置 ...
- cell的各种使用和赋值 总结
cell可以分为:自定义cell,系统的cell ,cell的自适应,.xib的cell //第一种cell:系统cell 在 UIViewController下创建UITableView //1.0 ...
- bootstrap小结
bootstrap总结 bootstrap总结 base css 我分为了几大类 1,列表 .unstyled(无样式列表),.dl-horizontal(dl列表水平排列) 2,代码 code(行级 ...
- 改造百度UMeditor(UEditor-min)富文本编辑器的图片上传功能
最近项目需要新增一个发布文章的模块,用的是百度的Ueditor富文本编辑器. 公司用的是阿里云的图片服务器,需要直接把文章中图片上传到服务器上,但是这个编辑器的上传图片是直接上传到Tomcat的根目录 ...
- poj2251 三维简单BFS
D - (热身)简单宽搜回顾 Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Subm ...
- 如何在WebSocket类中访问Session
我最近正在做一个基于websocket的webQQ,最后代码会开源带github上,所以过程中我就不贴所有的代码啦~就贴问题的关键. 我在WebSocket里发消息的时候需要用到session,因为在 ...
- Nlog从下载到使用例子
第一.首先下载nlog.dll 下载地址:http://pan.baidu.com/s/1i3DQsV7 第二.添加nlog.ll的引用 第三.代码 private static Logger log ...
- 转:Reddit排名算法工作原理
http://www.aqee.net/how-reddit-ranking-algorithms-work/ 这是一篇继<Hacker News 排名算法工作原理>之后的又一篇关于排名算 ...
- awk的接口实现方案1
module/a.awk function sum(a, b) { return a + b } module/b.awk function sum(a, b) { return a * b } ma ...
- java classpath import package 机制 @Java的ClassPath, Package和Jar
java classpath import package 机制 從一個簡單的例子談談package與import機制 基本原則:為什麼需要將Java文件和類文件切實安置到其所歸屬之Package ...