The content of the Weblogic File Created under/etc/init. d is as follows:
#! /Bin/bash
Weblogic_user = root
Weblogic_base =/home/jc6/Oracle/middleware/user_projects/domains/base_domain/bin
# Weblogic_user = Administrator
# Weblogic_base =/home/Administrator/domains/base_domain/bin
Export weblogic_user weblogic_base
Start (){
Echo-N $ "Starting webserver ..."
Su $ weblogic_user-c "nohup $ weblogic_base/startweblogic. Sh &"
Retval =$?
Echo done
[$ Retval-EQ 0]
# Touch/var/lock/subsys/WebLogic;
Return $ retval
}
Stop (){
Echo-N $ "Stopping webserver ..."
Su $ weblogic_user "$ weblogic_base/stopweblogic. Sh"
Retval =$?
Echo
[$ Retval-EQ 0]
# Rm-F/var/lock/subsys/WebLogic;
Return $ retval
}
Restart (){
Stop
Start
}
Reload (){
Echo-N $ "reloading Cron Daemon Configuration :"
Killproc crond-Hup
Retval =$?
Echo
Return $ retval
}
Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Restart)
Restart
;;
Reload)
Reload
;;
Status)
# Rhstatus
;;
Condrestart)
[Restart |:
;;
*)
Echo $ "Usage: $0 {START | stop | status | reload | restart | condrestart }"
Exit 1
Esac
Chmod 755 WebLogic changes file attributes
Note: In Windows, the file cannot run normally due to DOS format characters when editing the file. We recommend that you use gedit or VI to edit the file. No error control is added to the shutdownweblogic function, you can complete it yourself.
2. Establish a service connection:
To stop WebLogic at restart, we need the following link:
[Root @ js-Oracle init. d] # ln-S ../init. d/WebLogic/etc/rc. d/rc0.d/k01weblogic
[Root @ js-Oracle init. d] # ln-S ../init. d/WebLogic/etc/rc. d/rc6.d/k01weblogic
When the system starts WebLogic, we need the following link:
[Root @ js-Oracle init. d] # ln-S ../init. d/WebLogic/etc/rc. d/rc2.d/s99weblogic
[Root @ js-Oracle init. d] # ln-S ../init. d/WebLogic/etc/rc. d/rc3.d/s99weblogic
[Root @ js-Oracle init. d] # ln-S ../init. d/WebLogic/etc/rc. d/rc5.d/s99weblogic
Iii. Explanation:
When Linux is started:
Graphical interface: automatically calls/etc/rc. the symbolic connection name under D/rc5.d starts with S (meaning: Start/start) refers to the Service in the script file, and the command line parameter start is automatically passed.
When Linux is disabled:
Graphical interface: automatically calls/etc/rc. the symbolic connection name in D/rc5.d starts with K (meaning: Kill/Close) and automatically transmits the command line parameter stop.
Other running levels are similar (For details, refer to the/etc/rc. d/RC Script)
Create the content of the boot. properties File
Username = XXXXX
Password = XXXXX
This file is stored in/base_domain/Security and/base_domain/servers/adminserver of Weblogic respectively.
Success! restart OK