*PLUS/WINUTL/SERVICE Windows Task Monitor Service
 

This functionality is a +PxPlus Exclusive

Invocation: RUN "*plus/winutl/service"
   
Description 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.

To install (or uninstall) the service, RUN "*plus/winutl/service".

If the service is not already installed, it will ask if you would like it installed and for the configuration settings (starting directory). It will then install into your Windows services registry. You may have to run PxPlus as an administrator in order to have the registry updates take effect.

Once installed, you need to go to the Windows Control panel where, in the service section, you should now find the PxPlusInit service. The defaults are set for automatic start on reboot and interactive. You may 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 a 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 don't 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
!
! Pvx Plus Technologies -- Windows background service interface
!
! inittab file used by PxPlus
!
! Each line which starts with an alpha character is used to define
! a process to be run. The line format is:
!
! id option command
!
! Where:
! id : is a user defined identifier used to identify the task
! option : contains 'once' to spawn task only once during service start
! command : has the command line to be invoked.
! : (to simply run pxplus make first word on the command
! : pxplus -- the service will replace this with the pathname to
! : to the pxplus.exe in use by the service
!
! NOTE: Leading/trailing spaces on the lines will be stripped
!
! Examples:
!
!
! test1 once pxplus **
! test2 respawn pxplus *f
! test3 once notepad c:\pvxsrc\temp.txt

The initab 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.



*Note* Should a task marked as 'respawn' have to be relaunched more than 10 times within a 1-minute interval, the system will cease launching it until the inittab is changed.


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.