*PLUS/WINUTL/SERVICE Windows Task Monitor Service
The "*plus/winutl/service" utility provides a facility similar to the Unix/Linux 'inittab' functionality. It allows the application developer to have a series of processes spawned and monitored in the background of a Windows system.
(The *Plus/Winutl/Service utility was added in PxPlus v8.11.)
Installing as a Service on Windows
This utility can be installed as a Windows service using either of the following two methods:
Location | Method |
|---|---|
From the PxPlus IDE Main Launcher | Expand the Installation and Setup category and select Install Windows Services to launch the Install Windows Services interface. From the Type of Service drop box, select Inittab Emulation Server. After entering the service settings in the grid, select the Install button. |
From the PxPlus Command line | Enter: RUN "*plus/winutl/service" If installing, you will be asked to provide the configuration settings (Starting Directory). It will then install into your Windows services registry. You may be required to run PxPlus as an administrator to allow the registry updates to take effect. |
After installation is complete, the next step is to go to the Windows Control Panel and select Administrative Tools where, in the Services section, you should now find the PxPlusInit service. The defaults are set for Automatic Start on reboot and Interactive. You can change these as desired, and then start the process or reboot to have the system start it.
Inittab Entries
The file *plus/winutl/inittab contains the information regarding the tasks to be started and/or monitored by the service. It consists of a text file containing a list of tasks to run.
Each line that starts with an alpha character must describe a task/process to run in the following format:
For tasks that will be started only once during service startup:
taskid once command_line
For tasks that will be started during service startup then monitored and restarted should they terminate:
taskid respawn command_line
Task that you do not want started (or terminate if running) can have the option off, as in:
taskid off command_line
In the scenarios above:
The taskid is a user defined identifier for the process. It must start with a letter and may be up to 10 characters long.
The command_line contains the Windows command that will be executed to launch the process.
If the first word on the Command line is "pxplus", the service will replace it with the current pathname to PxPlus and the spawned task will have FID(0) set the taskid.
Provided Sample inittab |
|---|
|
The inittab file is scanned when the service is started and rescanned every 5 seconds to see if it has changed. To add/drop entries from the inittab, simply edit the file and the service will process the changes, generally within 5 seconds.
Logging
The service keeps track of its activity in the file "*plus/winutl/inittab.log". This file will contain the last 1000 events with each event being recorded with a date/time stamp. No maintenance is required on this file, as it will automatically limit itself to 1000 entries, dropping older entries, as needed.