Windows services and Unix daemons
Windows service
On Windows it's possible to install WebClient SDK tools as Windows services.
These services can be installed during the setup process:
Each command provides the following options:
Option | Action |
---|
-install | Installs the service in auto mode. The service will start automatically along with the operating system. |
-install-demand | Installs the service in demand mode. The service must be started by the user. |
-start | Starts the service. |
-status | Returns the status of the service. The possible exit codes are: 0 = the service is running 1 = the status cannot be determined 3 = the service is not running |
-stop | Stops the service. |
-uninstall | Removes the service. |
Example
To install the WebClient service, start it and check if it’s running, use these commands:
webclient -install webclient -start webclient -status |
Note - be sure to have administrator priviledges, or these commands will fail.
Non-interactive mode and custom name
In some situations, you might want to install a Windows service as a non-interactive service so that the service does not have any possibility to access the GUI subsystem. In order to do that, add the phrase non-interactive after the -install parameter. A custom service name can still be specified after the non-interactive parameter:
webclient -install non-interactive |
It’s also possible to specify a custom name for the service. This name should be added as last parameter of the command line for all the options. For example, the following list of commands manges an isCOBOL WebClient service named “myservice”:
webclient -install myservice webclient -start myservice webclient -status myservice webclient -stop myservice webclient -uninstall myservice |
Output redirection
The WebClient services redirect all the console output (stderr and stdout) to two files named <command>_err.log and <command>_out.log. These files are located in the bin directory, which is the default directory of the service.
Service configuration
Command-line Java options must be put in the <command>.vmoptions file, located in the isCOBOL bin directory, which is the default directory of the service. In this file, comments are prefixed by a hash and each option is on a separate line.
The following snippet shows how to configure memory limits, pass a custom configuration file and alter the Classpath for the WebClient service:
#memory settings -Xmx256m -Xms128m #configuration -Discobol.conf=/myapp/myconf #classpath -classpath/p . -classpath/a C:\dev\myclasses.jar |
The WebClient service inherits the Classpath from the system and adds all jar libraries in the lib directory to it. Using the -classpath option you can add additional items to the active Classpath. The value of -classpath/p is prepended to the active Classpath. The value of -classpath/a is appended to the active Classpath.
Note - On some Windows distributions it’s necessary to reboot the system in order to make services aware of modifications to the system environment.