Monday, July 7, 2014

APM UI 7.7 - Creating Windows Services

If you've installed APM UI v7.7 on a Windows server, you probably have noticed that IBM doesn't create Windows services.  As a result, none of the services start after a reboot, etc.

Below are the steps necessary to create Windows services for APM UI and SCR (Service Component Repository).  In this scenario, we have the SCR database using DB2 vs. Derby.

We've also included the commands necessary to create the service for SCR on Derby (however, this hasn't been tested).

Assumptions
Our base install directory for the APM UI is C:\IBM\APMUI - your path may differ, adjust the commands below as appropriate.

Procedure

  • Download the Apache Commons Daemon (link).
  • Extract commons-daemon-1.0.15-bin-windows.zip and copy prunsrv.exe to C:\IBM\APMUI\bin\
  • Open a Command Prompt and change into your C:\IBM\APMUI\bin directory 
  • Create the Windows service for SCR and have it depend on Tcpip and DB2 being up first.

prunsrv //IS//SCR --Startup=auto --DisplayName="IBM APMUI - SCR" --Description="IBM WebSphere Liberty Profile SCR" ++DependsOn=Tcpip ++DependsOn=DB2-0 --LogPath=C:\IBM\APMUI\usr\servers\apmui\logs --StdOutput=auto --StdError=auto --StartMode=exe --StartPath=C:\IBM\APMUI --StartImage=C:\IBM\APMUI\bin\server.bat --StartParams=start#scr --StopMode=exe --StopPath=C:\IBM\APMUI --StopImage=C:\IBM\APMUI\bin\server.bat --StopParams=stop#scr


  • Create the Windows service for APMUI and have it depend on SCR being up first.

prunsrv //IS//APMUI --Startup=auto --DisplayName="IBM APMUI - APMUI" --Description="IBM WebSphere Liberty Profile APMUI" ++DependsOn=SCR --LogPath=C:\IBM\APMUI\usr\servers\apmui\logs --StdOutput=auto --StdError=auto --StartMode=exe --StartPath=C:\IBM\APMUI --StartImage=C:\IBM\APMUI\bin\server.bat --StartParams=start#apmui --StopMode=exe --StopPath=C:\IBM\APMUI --StopImage=C:\IBM\APMUI\bin\server.bat --StopParams=stop#apmui


Derby vs. DB2

If you have SCR running under Derby vs. DB2, you can create a third service for SCRDERBY.  The start-up of SCR would then depend on SCRDERBY instead of DB2-0.


  • Create the Windows service for SCRDERBY and have it depend on TCPIP being up first
prunsrv //IS//SCRDERBY --Startup=auto --DisplayName="IBM APMUI - SCRDERBY" --Description="IBM WebSphere Liberty Profile SCRDERBY" ++DependsOn=Tcpip --LogPath=C:\IBM\APMUI\usr\servers\apmui\logs --StdOutput=auto --StdError=auto --StartMode=exe --StartPath=C:\IBM\APMUI --StartImage=C:\IBM\APMUI\bin\server.bat --StartParams=start#scrderby --StopMode=exe --StopPath=C:\IBM\APMUI --StopImage=C:\IBM\APMUI\bin\server.bat --StopParams=stop#scrderby


  • In this case, have the SCR service depend on SCRDERBY instead of DB2.
prunsrv //IS//SCR --Startup=auto --DisplayName="IBM APMUI - SCR" --Description="IBM WebSphere Liberty Profile SCR" ++DependsOn=Tcpip ++DependsOn=SCRDERBY --LogPath=C:\IBM\APMUI\usr\servers\apmui\logs --StdOutput=auto --StdError=auto --StartMode=exe --StartPath=C:\IBM\APMUI --StartImage=C:\IBM\APMUI\bin\server.bat --StartParams=start#scr --StopMode=exe --StopPath=C:\IBM\APMUI --StopImage=C:\IBM\APMUI\bin\server.bat --StopParams=stop#scr


The name specified after //IS// is effectively the "short name" for the service.  So, you can issue commands such as "net start apmui", "net stop scrderby", etc. based on those names.  As with all services, you can use the full Display Name  if you enjoy typing (net start "IBM APMUI - APMUI", etc.)

The typical startup sequence would be:

  • net start scrderby (if running Derby vs. DB2)
  • net start scr
  • net start apmui


The typical shutdown sequence would be:

  • net stop apmui
  • net stop scr
  • net stop scrderby (if running Derby vs. DB2)

prunsrv Documentation/Usage:

Here's a link to the prunsrv documentation/usage.


Sample - APMUI Service

Sample - APMUI Service Dependencies