Weblogic Startup Scripts

The following scripts and procedure allows stopping and starting of Weblogic Instances using Jython (Python) scripts and the nodemanager. Services are then created and can be used at startup and shutown for your NodeManager, Admin Server, and Managed Servers.


Version = Weblogic 10.3.6
MW_HOME = /u01/app/oracle/weblogic1036R2
JAVA_HOME = /u01/app/jdk
DOMAIN = IDMdomain
BOOTSCRIPTS LOCATION = /u01/app/oracle/$MW_HOME/bootscripts
Node Manager is installed and configured.

Configure the nodemanager as follows


Create the main wls.py script

Next is the startall.sh script





Before running this command (deprecated in 12c, but still works in 12.1.3), you must source setDomainEnv.sh for the domain you are using.

Encrypt username and password (11g)

Then run this command to create your encrypted User and Key files

Encrypt credentials for Weblogic


Now create your init.d startup scripts



The weblogic scripts call the startall.sh when the server starts, and stopall.sh when the server stops.



Both the nodemanager and weblogic startup scripts need to made runable (chmod 755) and then added to chkconfig

Update your Nodemanager type to be “Plain”

image2015-6-24 7-54-27

This can be done for each domain on your server

Well Done! Grab a beer


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


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


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


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


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


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!