Difference between revisions of "Running CTP as a Windows Service"

From MircWiki
Jump to navigation Jump to search
Line 2: Line 2:
  
 
==Background==
 
==Background==
The [http://mirc.rsna.org/CTP/CTP-installer.jar CTP installer] program is a self-extracting program that copies all the necessary files into a directory called <b>CTP</b> wherever the user requests it to be created. The installer creates a <b>windows</b> subdirectory containing these files:
+
The [http://mirc.rsna.org/CTP/CTP-installer.jar CTP installer] program is a self-extracting program that copies all the necessary files into a directory called <b><tt>CTP</tt></b> wherever the user requests it to be created. The installer creates a <b><tt>windows</tt></b> subdirectory containing these files:
  
 
*<b>CTP.exe</b> - the service which is run by the Windows service manager. It starts and stops the CTP.jar program.
 
*<b>CTP.exe</b> - the service which is run by the Windows service manager. It starts and stops the CTP.jar program.
Line 25: Line 25:
  
 
==Uninstalling the CTP Service==
 
==Uninstalling the CTP Service==
To uinstall the service:
+
To uninstall the service:
 
<ol>
 
<ol>
 
<li> Log into Windows in an account with administrator privileges
 
<li> Log into Windows in an account with administrator privileges
Line 38: Line 38:
 
<li> Close the command window
 
<li> Close the command window
 
</ol>
 
</ol>
 +
 +
==Changing the Service Parameters with the CTP Service Monitor==
 +
The <b>CTPw.exe</b> program provides control over all the parameters that the service uses. To run the program, <b>right</b>-click the program and select <b>Run as administrator</b>. It displays this CTP Properties dialog:
 +
 +
The properties dialog can be used to start or stop the service manually, but it is generally better to use the Windows service manager.
 +
 +
===Changing the Startup Type===
 +
The CTP service is initially configured to require that the service be started manually. This can be changed on the <b>General</b> tab.
 +
 +
===Changing the Java Parameters===
 +
The CTP service is initially configured to allocate 128MB to the Java memory pool and to allow the memory pool to expand to 512MB if necessary as it runs. For most applications, this is sufficient. For systems which implement many pipelines handling large images, it may be necessary to change these settings. To do so, click the <b>Java</b> tab to see this page:
 +
 +
==Technical Details==
 +
This section is included only for the interested technophile. It contains secret, highly technical information which will make you extremely attractive to women. Proceed at your own risk.
 +
 +
The <b>CTP.exe</b> program is the Apache Commons Daemon</b> which is used to run Tomcat. It is used here with  no modification except to change its name. The <b>install.bat</b> file provides all the parameters required to make it launch CTP.jar. The CTP installer modifies a template <b>install.bat</b> file when it installs the file in the <b><tt>CTP\windows</tt></b> directory, replacing the <b><tt>${home}</tt></b> fields with the actual path to the <b><tt>CTP</tt></b> directory.

Revision as of 19:52, 4 June 2010

This article describes how to install CTP as a Windows service. It is intended for administrators who want CTP to start automatically when its host computer starts and shut down cleanly when its host computer shuts down. This is the most convenient way to run CTP on a Windows system for applications in which CTP acts a resource for a clinical trial or as a front-end to another system. This article is written for Windows Vista and Windows 7, but it also works for Windows XP if you ignore the issues associated with User Account Control.

1 Background

The CTP installer program is a self-extracting program that copies all the necessary files into a directory called CTP wherever the user requests it to be created. The installer creates a windows subdirectory containing these files:

  • CTP.exe - the service which is run by the Windows service manager. It starts and stops the CTP.jar program.
  • CTPw.exe - the service monitor which allows the administrator to adjust the parameters which determine how CTP.jar runs.
  • install.bat - the Windows batch job which installs the CTP.exe service and provides a default set of parameters.
  • uninstall.bat - the Windows batch job which uninstalls the CTP.exe service.

2 Installing the CTP Service

To install the service:

  1. Log into Windows in an account with administrator privileges
  2. Launch a command window with administrator privileges
    • Click Start
    • Type cmd
    • Type Ctrl-Shift-Enter
  1. Navigate to the CTP directory
  2. Enter the command: install.bat
  3. Close the command window

3 Uninstalling the CTP Service

To uninstall the service:

  1. Log into Windows in an account with administrator privileges
  2. Launch a command window with administrator privileges
    • Click Start
    • Type cmd
    • Type Ctrl-Shift-Enter
  1. Navigate to the CTP directory.
  2. Enter the command: uninstall.bat
  3. Close the command window

4 Changing the Service Parameters with the CTP Service Monitor

The CTPw.exe program provides control over all the parameters that the service uses. To run the program, right-click the program and select Run as administrator. It displays this CTP Properties dialog:

The properties dialog can be used to start or stop the service manually, but it is generally better to use the Windows service manager.

4.1 Changing the Startup Type

The CTP service is initially configured to require that the service be started manually. This can be changed on the General tab.

4.2 Changing the Java Parameters

The CTP service is initially configured to allocate 128MB to the Java memory pool and to allow the memory pool to expand to 512MB if necessary as it runs. For most applications, this is sufficient. For systems which implement many pipelines handling large images, it may be necessary to change these settings. To do so, click the Java tab to see this page:

5 Technical Details

This section is included only for the interested technophile. It contains secret, highly technical information which will make you extremely attractive to women. Proceed at your own risk.

The CTP.exe program is the Apache Commons Daemon which is used to run Tomcat. It is used here with no modification except to change its name. The install.bat file provides all the parameters required to make it launch CTP.jar. The CTP installer modifies a template install.bat file when it installs the file in the CTP\windows directory, replacing the ${home} fields with the actual path to the CTP directory.