Since a service is run by the system and not by a user, the service must be registered with the system.
Once you have created an NT service class (see
ntseg.cpl for an example) you need
to register it. This is done by running the Carapace script interpreter and
executing the following commands:
(load "servgen.cpl")
(installService "caraweb.exe"
"Carapace Web Server"
"ntseg.cpl"
"c:/caradocs"
20
"auto"
"fred"
"topSecret"
()
)
To remove the service when it is no longer required, do the following:
(load "servgen.cpl")
(removeService "caraweb.exe")
Both installService and
removeService are described below.
The installService function takes the following arguments:
| name | type | description |
|---|---|---|
executableFilename |
String | this is the name of the executable to be started by the NT service
control manager -- it is constructed from the generic
service executable carantservice.exe which
lives in the Carapace bin directory
|
serviceName |
String | the name of the NT service should indicate the role the service performs -- this is the name which is seen in the NT services manager |
scriptFilename |
String | identifies the script which implements the NtService class -- this script should exist in the Carapace scripts directory |
startupString |
String | this is the string given to the start method of
the NtService class -- it is
put into the system registry as a parameter for the service
|
shutdownTimeout |
Integer | this is the timeout given to the stop
and shutdown methods of
the NtService class -- it is
put into the system registry as a parameter for the service
|
startupType |
String | this defines the way the service is started. Allowed
values are:
|
userName |
String | the account name of the NT user which is to run this service -- this must be an account for which Carapace has been installed |
password |
String | the password for the runtime NT service account |
dependencies |
List | the (possibly empty) list of names of services on which this service depends -- the system then ensures the required services are started before this one. |
The removeService function takes the following arguments:
| name | type | description |
|---|---|---|
executableFilename |
String | this is the name of the executable for the NT service |
| Contents | Index | Current topic: NT Services | Related topics: objects |