Running StarTeam Notification Agent as a Service

Many customers run both the StarTeam Server and StarTeam Notification Agent as services.

When running the StarTeam Server and StarTeam Notification Agent on the same computer, the StarTeam Server process must start before the StarTeam Notification Agent attempts to start. The best way to accomplish this is to set up a service dependency within Microsoft Windows.

If you are running the StarTeam Server as a service and StarTeam Notification Agent as a dependent service, you cannot shut down the StarTeam Server unless the StarTeam Notification Agent service is shut down first.

To avoid dependent servers, some customers run the StarTeam Server and StarTeam Notification Agent on different computers. When using two computers, you must first synchronize the times on both computers. If StarTeam Notification Agent returns a View Configuration exception, the two computers are probably not synchronized.

To run an instance of StarTeam Notification Agent as a service, do one of the following:

The example initially in this file is:

JavaService.exe -install NotificationAgent "C:\Program Files\Micro Focus\Java\
Sun1.4.1_02\bin\client\jvm.dll" -Djava.class.path="C:\Program Files\Micro Focus\
StarTeam Notification Agent\agent.jar";"C:\Program Files\Micro Focus\StarTeam
Notification Agent\starteamxx.jar" -Djava.library.path="C:\Program Files\Micro Focus\
StarTeam Notification Agent";"C:\Program Files\Micro Focus\StarTeam SDK x.x\lib"
-start com.starbase.starteam.workflow.NARuntime. NotificationAgentFrame -
params -service "C:\Program Files\Micro Focus\StarTeam Notification Agent\
localhost_49201.nac" -stop com.starbase.starteam.workflow.NARuntime.
NotificationAgentFrame -method stopAgent -out "C:\Program Files\Micro Focus\
StarTeam Notification Agent\NAService.log" -err "C:\Program Files\Micro Focus\
StarTeam Notification Agent\NAService.log" -current "C:\Program Files\Micro Focus\
StarTeam Notification Agent"
pause

This file contains several complete paths that you may need to replace with appropriate path names from your system. Most of these paths are delimited by double-quotation marks. These paths represent:

After running NotificationAgentService.bat, this instance of StarTeam Notification Agent runs as an automatic service and can be managed as any other automatic service.

CAUTION:
Changes to the registry should only be made by users who are experienced with the registry. Before making any changes always make a backup of the registry.

To set up a service dependency for Windows NT or 2000:

  1. Click Start > Run.
  2. Enter Regedt32.
  3. Click OK.
  4. Select HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\NotificationAgent
  5. Click Edit > Add Value.
  6. Set the Value Name to DependOnService.
  7. Set the Data Type to REG_MULTI_SZ.
  8. Enter your StarTeam Server Service name into the data window.

To set up a service dependency for WindowsXP

  1. Click Start > Run.
  2. Enter Regedt32.
  3. Click OK.
  4. Select HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\NotificationAgent
  5. Click Edit > New > Multi-String Value.
  6. Set the Value Name to DependOnService.
  7. Double-click the DependOnService value to open the Data window.
  8. Enter your StarTeam Server Service name into the data window.

To find your service name:

Each application service has a service name and a display name. You are probably familiar with the display names that you have seen in the Services applet in the control panel. The DependOnService command requires the service name, not the display name.

  1. Click Start > Run.
  2. Enter Regedt32.
  3. Click OK.
  4. Select HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.

    Search the list for any items prefaced with “StarTeamServer” .All application repositories are in a format of “StarTeamServer-RepositoryName”.

When the StarTeam Notification Agent runs, log files are placed into the installation folder "...\StarTeam Notification Agent". Review these logs to determine if the service is working successfully or not. Should changes need to be made to the NotificationAgentService.bat file to resolve problems, the following command will need to be run first to uninstall the service:

JavaService.exe -uninstall NotificationAgent

You can use a .bat file or enter the command at the DOS prompt. Run the command from the same location as you ran NotificationAgentService.bat file.

If an attempt to re-install the service fails after a successful uninstall, the server should be re-booted to complete the uninstall operation.