In today’s article, I will describe Adding / Running Weblogic Server as a Service in a different way.
First, get root rights with the “su” command and create a file called wlcservis under “/etc/rc.d/init.d/” and enter the code below.
You will need to edit the DOMAIN_HOME line according to you. I am doing my test installations under oracle. ”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#!/bin/bash . /etc/rc.d/init.d/functions ORACLE_OWNER="oracle" DOMAIN_HOME="/oracle/weblogic/user_projects/domains/user_domain" case "$1" in start) if ps ef | grep -v grep|grep startWebLogic.sh then echo "Weblogic server çalışıyor.";exit 0 else echo "Weblogic Servisi Başlıyor";/bin/su - $ORACLE_OWNER -c "/usr/bin/nohup $DOMAIN_HOME/bin/startWebLogic.sh /oracle/weblogic/logs/weblogic_$(date +%Y%m%d).log &" fi ;; stop) echo -n $"Weblogic server kapatılıyor:" /bin/su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/stopWebLogic.sh" echo "OK" ;; *) echo $"Usage: $0 {start|stop}" esac |
Now we are adding the service.
1 2 3 4 |
# chmod +x /etc/init.d/wlcservis # chkconfig --add wlcservis # chkconfig --list weblogic 0:off 1:off 2:off 3:on 4:on 5:on 6:off |
You can start or stop the service as follows.
1 |
Service Wlcservis start|stop |