Create Startup scripts for Weblogic Admin server and NodeManager
The following instructions are for creating Linux Startup scripts for Weblogic 10.x This procedure uses RC scripts for starting / shutting down the process as a UNIX daemon.
- Login to a root account
- Create the following file in the /etc/init.d/weblogic_start with the following contents. Modify to match your specific environment
su – oracle -c “nohup /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startWebLogic.sh &”
su – oracle -c “nohup /u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/startNodeManager.sh &”
- This will start the weblogic admin process as a specified user “oracle” and run it in the background.
- This will also start the NodeManager if configured.
su – oracle -c “/u01/app/oracle/middleware/user_projects/domains/DEV_domain/bin/stopWebLogic.sh”
kill -9 `ps -ef | grep weblogic.Node | grep jdk | awk ‘{print $2 }’`
- The image above shows the /etc/init.d/weblogic_stop script which will stop the Weblogic Admin server as well as stop the NodeManager.
- Next step is to create the symbolic links in the /etc/rc3.d directory so things will stop and start correctly.
- From the /etc/rc3.d directly you will need to run the following command to link the new weblogic_start and weblogic_stop scripts. Make sure you use the “S80” and “K20” in the names of the startup links.cd /etc/rc3.d
ln -s ../init.d/weblogic_start S80weblogic_start
ln -s ../init.d/weblogic_stop K20weblogic_stopThings should look like this:
lrwxrwxrwx. 1 root root 24 Apr 30 17:39 S80weblogic_start -> ../init.d/weblogic_start
lrwxrwxrwx. 1 root root 23 Apr 30 17:39 K20weblogic_stop -> ../init.d/weblogic_stop
- To test first make sure the commands run and work as designed.As root:
/etc/init.d/weblogic_start
/etc/init.d/weblogic_stop
- Next stop is to reboot and verify that the services come up and are functional.
3 comments
The script to kill the servers should be in rc.0 and linked as follows:
ln -s /etc/init.d/weblogic_stop /etc/rc.0/K20weblogic_stop
This wont work for me. When I run /etc/init.d/weblogic_start
[root@localhost ~]# /etc/init.d/weblogic_start
/etc/init.d/weblogic_start: line 1: ”: command not found
/etc/init.d/weblogic_start: line 2: ”: command not found
[root@localhost ~]# /u01/app/oracle/product/Middleware/user_projects/domains/clusteredDomain/bin/startWebLogic.sh: “nohup: command not found
/u01/app/oracle/product/Middleware/user_projects/domains/clusteredDomain/bin/startManagedWebLogic.sh: “nohup: command not found
Any ideas why, the paths are correct as I can run them if I copy and straight into the command line.
Author
Try this way, it’s kind of the supported way to do things now with Weblogic. Uses the nodemanager.
/weblogic-startup-scripts/