1. Create WebLogic Boot file
[Email protected] ~]# cd/etc/rc.d/init.d/
Copy the script into the WebLogic file
#!/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 "$" 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. Give executable permission to file WebLogic
#chmod +x WebLogic
3. Add to the list of services
[Email protected]]# chkconfig--add WebLogic
4, check whether to add success
[[Email protected]]# chkconfig--list | grep WebLogic
WebLogic 0: off 1: Off 2: Off 3: Enable 4: Enable 5: Enable 6: Off
5. How to use:
The WebLogic Application Server WebLogic service starts automatically when you start or restart.
Stop WebLogic Service
[[Email protected] init.d]# service WebLogic Stop (or/etc/rc.d/init.d/weblogicstop)
Shutdown Weblogic:ok
Kai WebLogic Service
[[Email protected] init.d]# service WebLogic start (or/etc/rc.d/init.d/weblogicstart)
Starting Weblogic,log File/weblogic/bea/user_projects/domains/csky/weblogic.log:ok
WebLogic Startup scripts