WebLogic启动脚本

在启动WebLogic时,先结束掉之前启动的进程再启动

# !/bin/sh
# 启动bin文件夹下的startWebLogic.sh时,里面仍有其他脚本,临时文件中得到的进程id是startWebLogic.sh进程的id,即父进程id
# 存放PID(父进程)文件的文件夹
pidPath="pid/"

if [ ! -x "$pidPath" ]; then
  mkdir "$pidPath"
fi

# listener PID文件
listenerPidFile=$pidPath"listener.pid"
if [ -f "$listenerPidFile" ]; then
	PID=`cat $listenerPidFile`
	if [ -n "$PID" ]; then
		kill -9 $PID
	fi
fi

# 启动一个监听(里面有监听端口号,所以也要手动结束掉)
nohup java -cp WEB-INF/classes/ com.Listener>/dev/null 2>&1 &echo $! > $listenerPidFile&


# startWebLogic.sh PID(父进程)文件
pidFile=$pidPath"quick_trans.pid"
# 根据父进程id删除子进程
if [ -f "$pidFile" ]; then
	PRID=`cat $pidFile`
	if [ -n "$PRID" ]; then
		ps -ef|awk '{if($3=='$PRID'){system("kill -9 "$2)} }'
	fi
fi

# 启动WebLogic
nohup /root/home/Oracle/Middleware/user_projects/domains/base_domain/bin/startWebLogic.sh>/dev/null 2>&1 &echo $! > $pidFile&


注意:

1、执行脚本修改后,将文件转化成unix格式,否则报“syntax error: unexpected end of file”错误
用vi或vim编辑器,在命令模式下输入:
:set fileformat=unix
:wq!   

2、-bash: ./**.sh: Permission denied问题

chmod +x **.sh //授权

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值