Skip to content
Snippets Groups Projects
README.md 7.47 KiB
Newer Older
  • Learn to ignore specific revisions
  • jfp's avatar
    jfp committed
    # Supervisor-vms: A Process Control System for OpenVMS
    Supervisor-vms is a tools that allows to monitor and control a number of processes on OpenVMS systems.
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    Use process termination mailbox and AST. No CPU usage if no event occurs.
    
    
    jfp's avatar
    jfp committed
    - [Supervisor-vms: A Process Control System for OpenVMS](#supervisor-vms-a-process-control-system-for-openvms)
      - [Requirements](#requirements)
      - [Components](#components)
    
    jfp's avatar
    jfp committed
      - [Running supervisord](#running-supervisord)
        - [supervisord Command-Line Options](#supervisord-command-line-options)
    
    jfp's avatar
    jfp committed
      - [Running supervisorctl](#running-supervisorctl)
        - [supervisorctl Command-Line Options](#supervisorctl-command-line-options)
    
    jfp's avatar
    jfp committed
        - [supervisorctl Actions](#supervisorctl-actions)
    
    jfp's avatar
    jfp committed
      - [Configuration file](#configuration-file)
        - [File Format](#file-format)
    
    jfp's avatar
    jfp committed
        - [**\[supervisord\]** Section Settings](#supervisord-section-settings)
          - [**\[supervisord\]** Section Values](#supervisord-section-values)
        - [**\[program:x\]** Section Settings](#programx-section-settings)
          - [**\[program:x\]** Section Values](#programx-section-values)
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    It was inspired by *[supervisor](http://supervisord.org/)*
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    Read the supervisor documentation is probably a good idea. Many of configuration parameters are the same.
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    ## Requirements
    1. Python 3.10 (VSI version)
    
    jfp's avatar
    jfp committed
    1. ovms module
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    Probably better to use the LD image which contains all the necessary modules.
    
    jfp's avatar
    jfp committed
    ## Components
    
    
    jfp's avatar
    jfp committed
    All logicals are defined in table **SUPERVISORD_TABLE**
    
    jfp's avatar
    jfp committed
    
    **supervisord.py**
    
    
    jfp's avatar
    jfp committed
    The server piece of supervisor is named supervisord.<br>
    It is responsible for starting  processes (programs) at its own invocation, responding to commands from clients, restarting crashed or exited processeses
    
    jfp's avatar
    jfp committed
    
    The server process uses a configuration file.
    
    **supervisorctl.py**
    
    
    jfp's avatar
    jfp committed
    The command-line client piece of the supervisor is named supervisorctl.
    
    It provides a shell-like interface to the features provided by supervisord.
    
    
    jfp's avatar
    jfp committed
    From **supervisorctl**, a user can connect to the **supervisord** process, get status on the processes controlled by, stop and start processes of, and get lists of running processes (programs).
    
    jfp's avatar
    jfp committed
    
    The command-line client talks to the server across a mailbox (SUPERVISORD_CMD logical)
    
    
    jfp's avatar
    jfp committed
    ## Running supervisord
    
    jfp's avatar
    jfp committed
    Required privileges: **ALTPRI, SYSNAM, PRMMBX, IMPERSONATE, SETPRV, WORLD**
    
    jfp's avatar
    jfp committed
    
    First create a **supervisord.conf**, you can use the template **supervisord.conf_template** as an example.
    
    Then start **supervisord**, probably in **nodaemon** mode initially.
    
    Finally, if all seem correct, shutdown it and restart it on daemon mode.
    
    
    jfp's avatar
    jfp committed
    Running processes doesn't need to be stopped.<br>
    When restarting **supervisord** find the necessary informations for running processes using the logical name table **SUPERVISORD_TABLE**.
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    ### supervisord Command-Line Options
    
    jfp's avatar
    jfp committed
    <dl>
    <dt><strong>-c FILE, --configuration=FILE</strong></dt>
    <dd>The path to a **supervisord** configuration file. Unix syntax should be used</dd>
    <dt><strong>-n, --nodaemon</strong></dt>
    <dd>Run supervisord in the foreground</dd>
    <dt><strong>-p pwd, --password=pwd</strong></dt>
    <dd>Optional password, used with <strong>supervisorctl</strong></dd>
    <dt><strong>-h, --help</strong></dt>
    <dd>Show supervisord command help</dd>
    </dl>
    
    jfp's avatar
    jfp committed
    
    ## Running supervisorctl
    Required privilege: **PRMMBX, SYSNAM**
    ### supervisorctl Command-Line Options
    
    jfp's avatar
    jfp committed
    <dl>
    <dt><strong>-c FILE, --configuration=FILE</strong></dt>
    <dd>The path to a <strong>supervisord</strong> configuration file. Unix syntax should be used</dd>
    <dt><strong>-p pwd, --password=pwd</strong></dt>
    <dd>Optional password, used with <strong>supervisord</strong></dd>
    <dt><strong>-h, --help</strong></dt>
    <dd>Show supervisord command help</dd>
    </dl>
    
    jfp's avatar
    jfp committed
    
    
    jfp's avatar
    jfp committed
    ### supervisorctl Actions
    
    jfp's avatar
    jfp committed
    <dl>
    <dt><strong>help</strong></dt>
    <dd>Print a list of available actions</dd>
    <dt><strong>help &lt;action&gt;</strong></dt>
    <dd>Print help for &lt;action&gt;</dd>
    <dt><strong>start &lt;name&gt;</strong></dt>
    <dd>Start a process</dd>
    <dt><strong>start &lt;name&gt; &lt;name&gt;</strong></dt>
    <dd>Start multiple processes</dd>
    <dt><strong>start all</strong></dt>
    <dd>Start all processes</dd>
    <dt><strong>status</strong></dt>
    <dd>Get all process status info.</dd>
    <dt><strong>status &lt;name&gt;</strong></dt>
    <dd>Get status on a single process by name</dd>
    <dt><strong>status &lt;name&gt; &lt;name&gt;</strong></dt>
    <dd>Get status on multiple named processes</dd>
    <dt><strong>stop &lt;name&gt;</strong></dt>
    <dd>Stop a process</dd>
    <dt><strong>stop &lt;name&gt; &lt;name&gt;</strong></dt>
    <dd>Stop multiple processes</dd>
    <dt><strong>stop all</strong></dt>
    <dd>Stop all processes</dd>
    
    jfp's avatar
    jfp committed
    <dt><strong>shutdown</strong></dt>
    
    jfp's avatar
    jfp committed
    <dd>Stop <strong>supervisord</strong>, don't stop processes</dd>
    
    jfp's avatar
    jfp committed
    </dl>
    
    jfp's avatar
    jfp committed
    
    ## Configuration file
    The Supervisor configuration file is conventionally named supervisord.conf. <br>
    It is used by both **supervisord** and **supervisorctl**.
    
    ### File Format
    
    **supervisord.conf** is a Windows-INI-style (Python ConfigParser) file.<br>
    It has sections (each denoted by a **[header]**) and key / value pairs within the sections.<br>
    The sections and their allowable values are described below.
    
    
    jfp's avatar
    jfp committed
    ### **[supervisord]** Section Settings
    
    jfp's avatar
    jfp committed
    All pathname use a **OpenVMS** syntax.
    
    jfp's avatar
    jfp committed
    #### **[supervisord]** Section Values
    
    jfp's avatar
    jfp committed
    <dl>
    <dt><strong>nodaemon</strong></dt>
    <dd>If true, supervisord will start in the foreground instead of daemonizing<br>Default: false</dd>
    <dt><strong>user</strong></dt>
    <dd>OpenVMS account to run <strong>supervisord</strong> as a detach process (daemon mode).<br> Default: system</dd>
    <dt><strong>command</strong></dt>
    <dd>Command procedure which run supervisord.<br>Default: None, should be specified, can be build from the template 
    supervisord.com_template</dd>
    <dt><strong>stdout_file</strong></dt>
    <dd>stdout of supervisord process.<br>Default: NLA0:</dd>
    <dt><strong>logfile</strong></dt>
    <dd>The path to the activity log of the supervisord process<br>Default: supervisord.log</dd>
    
    jfp's avatar
    jfp committed
    </dl>
    
    ### **[program:x]** Section Settings
    The configuration file must contain one or more program sections in order for supervisord to know which programs it should start and control.<br>
    The header value is composite value.
    <br>It is the word “program”, followed directly by a colon, then the program name.<br>
    Read the *[$creprc](https://docs.vmssoftware.com/vsi-openvms-system-services-reference-manual-a-getuai/#JUN_147)* documentation may be useful.
    
    #### **[program:x]** Section Values
    <dl>
    <dt><strong>image</strong></dt>
    <dd>Name of the image to be activated in the newly created process<br>
    Default: <strong>SYS$SYSTEM:LOGINOUT.EXE</strong></dd>
    <dt><strong>command</strong></dt>
    <dd>Equivalence name to be associated with the logical name SYS$INPUT in the logical name table of the created process<br>
    Default: NLA0:</dd>
    <dt><strong>process_name</strong></dt>
    <dd>Process name to be assigned to the created process.<br>
    Default: %(program_name)s</dd>
    <dt><strong>user</strong></dt>
    <dd>Instruct supervisord to use this OpenVMS user account as the account which runs the program.<br>
    Default: None, mandatory</dd>
    <dt><strong>autostart</strong></dt>
    <dd></dd>
    <dt><strong>stdout_file</strong></dt>
    <dd></dd>
    <dt><strong>stderr_file</strong></dt>
    <dd></dd>
    <dt><strong>startsecs</strong></dt>
    <dd></dd>
    <dt><strong>startretries</strong></dt>
    <dd></dd>
    <dt><strong>stopwaitsecs</strong></dt>
    <dd></dd>
    <dt><strong>kt_limit</strong></dt>
    <dd></dd>
    <dt><strong>baspri</strong></dt>
    <dd></dd>
    <dt><strong>nouaf</strong></dt>
    <dd></dd>
    <dt><strong>quotas</strong></dt>
    <dd></dd>
    <dt><strong>privileges</strong></dt>
    <dd></dd>
    <dt><strong>autorestart</strong></dt>
    <dd></dd>
    <dt><strong>exitcodes</strong></dt>
    <dd></dd>
    </dl>