Monday, February 4, 2019

server - Service not starting at machine boot up - Ubuntu 14.04.1 LTS

I created Weblogic server as a service to start at boot up of machine by creating weblogic file inside directory /etc/init.d/ with below content:



#!/bin/sh


. /etc/default/weblogic

start() {
nohup ${WLSHOME}/server/bin/startNodeManager.sh && ${WLSHOME}/common/bin/wlst.sh /opt/nmstart-${ADMINSERVER}.py
for i in $SERVERS; do
${WLSHOME}/common/bin/wlst.sh /opt/start-"$i".py &
done
}


stop() {
${DOMAINPATH}/bin/stopWebLogic.sh -username ${USER} -password ${PASSWORD}
}

case "$1" in
start)
start
;;
stop)
stop

;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac



and another file with same name(weblogic) inside directory /etc/default/ with content as follows:



# /etc/default/weblogic script used to configure the init script
WLSHOME="/opt/weblogic/wlserver_10.3"
DOMAINPATH="/opt/weblogic/projects/test"

# Username password for stopping
USER="weblogic"
PASSWORD="weblogic1"


# Servers to start
SERVERS="wlserver-1 wlserver-2 "
ADMINSERVER="AdminServer"


When I run the command sudo service weblogic start, server starts but on restarting the machine weblogic service not started.



Then, I followed this and this questions to make it work, but none of them works for me.




P.S: running the command sudo update-rc.d weblogic defaults, gives me output:



update-rc.d: warning: /etc/init.d/weblogic missing LSB information
update-rc.d: see
System start/stop links for /etc/init.d/weblogic already exist.


Any idea how can I make weblogic service to start at machine boot up?



Thanks, any help will be appreciated.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...