Starting WLS as a daemon process
Create the folloing script in /etc/init.d (as root)
/etc/init.d/oracle-wls
#!/bin/bash
#
# /etc/rc.d/init.d/oracle-wls
#
# Starts the weblogic environment
#
# chkconfig: 2345 90 10
# description: Oracle-WLS Daemon
# processname: oracle-wls
source /etc/rc.d/init.d/functions
### Default variables
SYSCONFIG=”/etc/sysconfig/oracle-wls”
### Read configuration
[ -r “$SYSCONFIG” ] && source “$SYSCONFIG”
RETVAL=0
prog=”/home/oracle/bin/wls.sh”
desc=”Oracle WLS Daemon”
SU=/bin/su
SHELL=/bin/bash
START_AS_USER=oracle
start() {
echo -n $”Starting $desc ($prog): “
$SU -s $SHELL $START_AS_USER -c “$prog start” > /dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
echo
}
stop() {
echo -n $”Shutting down $desc ($prog): “
$SU -s $SHELL $START_AS_USER -c “$prog stop” > /dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
RETVAL=$?
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
*)
echo $”Usage: $0 {start|stop|restart|condrestart}”
RETVAL=1
esac
exit $RETVAL
Make the script known the O/S for the various boot levels (as root):
chkconfig –add oracle-wls && chkconfig oracle-wls on
You can test the script (as root)
# service oracle-wls stop
Shutting down Oracle WLS Daemon (/home/oracle/bin/wls.sh): [ OK ]
# service oracle-wls start
Starting Oracle WLS Daemon (/home/oracle/bin/wls.sh): [ OK ]
3 Comments
Hey Sandeep,
It is a great help for WLAs.
I will be appreciated if you would take some more time for us, have a little description in detail about what before need to do and after the script.
Thanks for sharing …
Pavan WLA
Hi Pavan,
Thanks for you reply.
I will try to get some time to mention the details.
Hi Sandeep,
I installed JRokcit 27.5.0 and installed Oracle WLS 10.3.3(generic)-64 bit.JRockit Mission Control 4.0.1 for Linux X86- 64. [jrmc-4.0.1-1.6.0-linux-x64.bin. How can i change/point WLS to JRockit Mission Control, without un-installing WLS.I don’t want to change during creating web logic domain.
I guess I need to change JAVA_HOME PATH ? What files do I need to change?
Let me know if I have to modify anything apart from this.
Thanks
Appreciate your time
Arvind