Defining a service object
You define a service object with the MQSC command DEFINE SERVICE.
The attributes that you need to define are as follows:
- SERVTYPE
- Defines the type of the service object. Possible values are as follows:
- SERVER
- A server service object.
Only one instance of a server service object can be executed at a time. The status of server service objects can be monitored using the MQSC command, DISPLAY SVSTATUS.
- COMMAND
- A command service object.
Multiple instances of a command service object can be executed concurrently. The status of a command service objects cannot be monitored.
- STARTCMD
- The program that is executed to start the service. A fully qualified path to the program must be specified.
- STARTARG
- Arguments passed to the start program.
- STDERR
- Specifies the path to a file to which the standard error (stderr) of the service program should be redirected.
- STDOUT
- Specifies the path to a file to which the standard output (stdout) of the service program should be redirected.
- STOPCMD
- The program that is executed to stop the service. A fully qualified path to the program must be specified.
- STOPARG
- Arguments passed to the stop program.
- CONTROL
- Specifies how the service is to be started and stopped:
- MANUAL
- The service is not to be started automatically or stopped automatically. It is controlled by use of the START SERVICE and STOP SERVICE commands. This is the default value.
- QMGR
- The service being defined is to be started and stopped at the same time as the queue manager is started and stopped.
- STARTONLY
- The service is to be started at the same time as the queue manager is started, but is not requested to stop when the queue manager is stopped.