標籤:weblogic
1、建立weblogic開機檔案
[[email protected] ~]# cd /etc/rc.d/init.d/
[[email protected] init.d]# vim weblogic
將一下指令碼複製到weblogic檔案中
#!/bin/bash # chkconfig: 345 20 80 # description: Weblogic Server auto start/stop script.# /etc/rc.d/init.d/weblogic # Please edit the variable export BEA_BASE=/resource/weblogic/export BEA_HOME=$BEA_BASE/user_projects/domains/UC_domain/binexport BEA_LOG=$BEA_HOME/weblogic.logexport PATH=$PATH:$BEA_HOMEBEA_OWNR="weblogic"# if the executables do not exist -- display error if [ ! -f $BEA_HOME/startWebLogic.sh -o ! -d $BEA_HOME ]then echo "WebLogic startup: cannot start" exit 1fi# depending on parameter -- startup, shutdown, restart case "$1" in start) echo -n "Starting WebLogic,log file $BEA_LOG: " touch /var/lock/weblogic su - $BEA_OWNR -c "cd ${BEA_HOME}; nohup ./startWebLogic.sh > $BEA_LOG 2>&1 &" echo "OK" ;; stop) echo -n "Shutdown WebLogic: " rm -f /var/lock/weblogic su - $BEA_OWNR -c "cd ${BEA_HOME}; ./stopWebLogic.sh >> $BEA_LOG" echo "OK" ;; reload|restart) $0 stop $0 start ;; *) echo "Usage: `basename $0` start|stop|restart|reload" exit 1esacexit 0
2、給檔案weblogic賦予可執行許可權
#chmod +x weblogic
3、添加到服務列表中
[[email protected]]# chkconfig --add weblogic
4、檢查是否添加成功
[[email protected]]# chkconfig --list | grep weblogic
weblogic 0:關閉1:關閉2:關閉3:啟用4:啟用5:啟用6:關閉
5、使用方法:
開機或重啟weblogic應用伺服器weblogic服務會自動啟動。
停weblogic服務
[[email protected] init.d]# service weblogic stop(或/etc/rc.d/init.d/weblogicstop)
Shutdown WebLogic: OK
啟weblogic服務
[[email protected] init.d]# service weblogic start(或/etc/rc.d/init.d/weblogicstart)
Starting WebLogic,log file/weblogic/bea/user_projects/domains/csky/weblogic.log: OK
weblogic啟動指令碼