Weblogic startup scripts using “UpStart”

I previously wrote on how to create weblogic startup scripts using standard init.d scripting. There is an even easier way to do things now. Why not use upstart, which is an event based replacement for the /sbin/init daemon.

Simply create a file “wlnode.conf” and put it in the /etc/init directory. This will start the Weblogic Nodemanager. You will need to modify based on your installation of course.

1st Weblogic Server

/etc/init/wlnode.conf

start on runlevel [345]
# console output
exec /bin/su - oracle -- /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startWebLogic.sh

Now you want the Weblogic Admin to start as well? Create a file called wladmin.conf

/etc/init/wladmin.conf

start on runlevel [345]
# console output
exec /bin/su - oracle -- /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startWebLogic.sh

Do you have any instances? You can start them too. Create a file called wlinstance1.conf

/etc/init/wlinstance1.conf

start on runlevel [345]
exec /bin/su - oracle -- /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startManagedWebLogic.sh instance1

To start and stop and find status, simply run “start wlnode”, “stop wlnode” and “status wlnode” using whatever you named your config file in /etc/init.

If you have a cluster setup, then you need to make sure the node manager is running and configured correctly on the second server. Once that is setup, you can add the following Upstart config files to bring everything up.

Second Weblogic Server

/etc/init/wlnode.conf

start on runlevel [345]
# console output
exec /bin/su - oracle -- /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startWebLogic.sh

/etc/init/wlinstance2.conf

start on runlevel [345]
exec /bin/su - oracle -- /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startManagedWebLogic.sh instance2 http://centos.my.lan:7001

This is just a quick example and much more can be done using UpStart!

Leave a Reply