supervisor_programs

Synopsis

Provide a list of program managed by one (or several) supervisors instances.

This is a reference part. Refer to the associated overview for a more synthetical view.

Attributes

Each item of the list has the following attributes:

Name req? Description
supervisor yes The supervisor managing this program
name yes Name of the program.
scope no On which target does this supervisor's program be deployed? May be:
  • A single host name
  • A single host_group name
  • Several hosts or host_groups, separated by the character ':'
Default to the supervisor's scope
command yes if conf_file_src is not provided The command to launch. Refer to the supervisor documentation
no_remove no Boolean: Prevent this program to be removed when HADeploy will be used with --action remove.
Default: no
user no From the supervisor documentation: Instruct supervisord to use this UNIX user account as the account which runs the program. The user can only be switched if supervisord is run as the root user. If supervisord can’t switch to the specified user, the program will not be started.
Default is the supervisord's user.
state no
  • started: The program will be started on deployment
  • stopped: The program will be stopped on deployment.
  • current: The program state will be left unchanged during deployment. (stopped on initial creation).
  • Default value: started.
    autostart no Boolean. If true, this program will start automatically when supervisord is started. Refer to the supervisor documentation
    process_name no Refer to the supervisor documentation
    numprocs no Integer. Refer to the supervisor documentation
    numprocs_start no Integer. Refer to the supervisor documentation
    priority no Integer. Refer to the supervisor documentation
    startsecs no Integer. Refer to the supervisor documentation
    startretries no Integer. Refer to the supervisor documentation
    autorestart no Refer to the supervisor documentation
    exitcodes no List of Integer. Refer to the supervisor documentation
    stopsignal no Refer to the supervisor documentation
    stopwaitsecs no Integer. Refer to the supervisor documentation
    stopasgroup no Boolean. Refer to the supervisor documentation. May be required if your program fork another one.
    killasgroup no Boolean. Refer to the supervisor documentation
    redirect_stderr no Boolan. Refer to the supervisor documentation
    stdout_logfile no Refer to the supervisor documentation
    stdout_logfile_maxbytes no Refer to the supervisor documentation
    stdout_logfile_backups no Integer. Refer to the supervisor documentation
    stderr_logfile no Refer to the supervisor documentation
    stderr_logfile_maxbytes no Refer to the supervisor documentation
    stderr_logfile_backups no Integer. Refer to the supervisor documentation
    environment no List of String. Refer to the supervisor documentation
    directory no Refer to the supervisor documentation
    umask no Refer to the supervisor documentation
    when no Boolean. Allow conditional deployment of this item.
    Default True

    Example

    supervisor_programs:
    - name: program1
      supervisor: tech1
      command: "/bin/bash /opt/tsupervisor/program1.sh"
    

    This snippet create a program 'program1' running as a daemon. This program being a simple shell script (program1.sh) and will be managed by the supervisor named tech1.

    This program can then be managed (stopped/restarted/...) by:

    Another example, with more parameters:

    supervisor_programs:
    - name: program2
      supervisor: tech1
      command: "/bin/bash /opt/tsupervisor/program2.sh"
      stopasgroup: yes
      environment:
      - MY_HOME="/opt/program2"
      - JAVA_HOME="/usr/java/jdk1.8.0_74"
      directory: /opt/program2/work
      stdout_logfile: /opt/program2/logs/program2.out
      stderr_logfile: /opt/program2/logs/program2.err
    

    About managed programs