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 理解不深,下文中的各文件及安全规则虽都是我所编写,但也是一边查 ...
随机推荐
- Linux命令:TOP
top命令 是Linux下常用的性能 分析工具 ,能够实时显示系统 中各个进程的资源占用状况,类似于Windows的任务管理 器.下面详细介绍它的使用方法. top - 02:53:32 up 16 ...
- mysql对GIS空间数据的支持,包括创建空间索引
CREATE TABLE tb_geo( id INT PRIMARY KEY AUTO_INCREMENT, NAME ) NOT NULL, pnt POINT NOT NULL, SPATIAL ...
- JQuery中parents和closest的区别
jquery中查找上层元素一般都习惯了用parents方法,往往忽略了还有一个效率更高的closest方法,看下w3cschool的解释 过程不一样,closest是找到一个即停止,而parents将 ...
- Double Strings Solved Problem code: DOUBLE
# Fuking silly, OTZ.... import sys def main(): n = int(raw_input()) for num in sys.stdin: if int(num ...
- 免费馅饼(HDU 1176 DP)
免费馅饼 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submis ...
- C语言学习中容易模糊的一些概念
1.什么叫分配内存 操作系统把某一块内存空间的使用权利分配给该程序 2.释放内存 操作系统把分配给该程序的内存空间的使用权利收回,该程序就不能再使用这块内存空间 注:释放内存空间并不是把这块内存的数据 ...
- JDK PATH 和 CLASSPATH环境变量的作用及其配置
(1)PATH环境变量的作用 在安装JDK程序之后,在安装目录下的bin目录中会提供一些开发Java程序时必备的工具程序. 对于Java的初学者,建议在命令符模式下使用这些工具程序编译运行Java程序 ...
- POJ 1379 Run Away
题意:有n个陷阱,在X,Y范围内要求出一个点使得这个点到陷阱的最小距离最大. 思路:模拟退火,随机撒入40个点,然后模拟退火随机化移动. (这题poj坑爹,加了srand(time(NULL))不能交 ...
- cf448A Rewards
A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- 使用jQuery来检测远程图片文件是否存在
使用jQuery来检测远程图片文件是否存在 最近为我的憨豆人笑园添加图片功能时,遇到了这个问题,用户可以填写一个远程的图片地址,也可以上传一个本地图片.为了不浪费服务器的资源,我们需要在客户端先对用户 ...