Skip to content

Add support for %(numprocs)d for command line #1269

@scaytrase

Description

@scaytrase

We have a case when the executed command want to known total number of processes in order to partition processed data so we intended to run it like

[program:partitioned-processor]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/bin/php data process --threads=%(numprocs)d --thread=%(process_num)d
autostart=true
autorestart=true
user=www-data
numprocs=8
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0

And we wan't to use numprocs from config directly rather configuring both of them with env variable (i think it would be better to configure numprocs with env, and the command will use numproces and process_num to be consistent)

currently we get

Error: Format string '/usr/local/bin/php data process --threads=%(numprocs)d --thread=%(process_num)d' for 'program:partitioned-processor' contains names ('numprocs') which cannot be expanded. Available name
s: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions