Tuesday 4 June 2019

converting weblogic processes into services - and getting things to autostart on windows

Here is a simple tip for anyone to be a better technical person.  If you ever build a machine, please ensure that everything starts automatically.  You need scripts and you need to test that when the machine starts, everything starts.  You job is NOT done until this occurs. <!--[if !mso]><![endif]

Here is a quick trick for registering all of your weblogic processes as services, and therefore getting them to start automatically. 

This will be beneficial when you are looking at cloud and looking to save money.

Firstly you'll find "install

There is a template file in C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin which probably has the wrong dirs specified (if you did not keep standard, or even if you did).  Check the path of the last two lines.

In C:\Oracle\Middleware\Oracle_Home\user_projects\domains\E1_Apps\bin you'll have 
installSvc.cmd for the node manager, run this.

Then create a copy of installSvc, and make it look something like the below.

Note that the names of the servers are from:
C:\Oracle\Middleware\Oracle_Home\user_projects\domains\E1_Apps\servers>dir /B
12345-myAccess-standalone
9201_PS920_F5WEB
9202_DV920_F5WEB
9204_MKT920_F5WEB
9205_PLAY920_F5WEB
9206_CONFIG_F5WEB
9208_PLAY920_AISHTML
9212_DV920_AIS_F5WEB
9215_PLAY920_AIS_F5WEB
9222_DV920_ORCH_F5WEB
9225_PLAY920_IOT_F5WEB
9235_PLAY920_ADF_F5WEB
9245_DV920_BSSV_F5WEB
AdminServer
AdminServerTag
domain_bak
testing

Create your file and run it, then you'll have services!

SETLOCAL
set DOMAIN_NAME=E1_Apps
set USERDOMAIN_HOME=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\E1_Apps
set SERVER_NAME=9201_PS920_F5WEB
set PRODUCTION_MODE=true
set ADMIN_URL=http://10.10.1.108:7001
call "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\E1_Apps\bin\setDomainEnv.cmd"
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9202_DV920_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9204_MKT920_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9205_PLAY920_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9206_CONFIG_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9208_PLAY920_AISHTML
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9212_DV920_AIS_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9215_PLAY920_AIS_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9222_DV920_ORCH_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9225_PLAY920_IOT_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9235_PLAY920_ADF_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
set SERVER_NAME=9245_DV920_BSSV_F5WEB
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
ENDLOCAL

If you want to add some dependencies, follow this

  1. Click Start, click Run, and enter regedit.
  2. Expand to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  3. Right-click the service that you are trying to set a dependency for and select New - Multi-string Value.
  4. Rename the new value to DependOnService.
  5. Double-click the DependOnService value and enter the dependent service name (from above) into the Value Data: field and click OK.
  6. Close the registry editor.
  7. Restart the server