从php添加到Supervisord的新程序

I am looking for a way to add a new program(job) to supervisord from php which does not exist in supervisor's config file.

It could look like this:

$supervisord = new SupervisordMgr(...);

$process = new Prod('path/to/worker-x.sh');
$supervisord->addProcess($process);

$process->getStatus();
$process->stop();

Supervisord has an API, so it should be a way to do this.

Is there anything out there?

Thanks

Make an entry for the process "[program:x,]" you want to start dynamically, in supervisord.conf and issue "supervisorctl update" command afterwards. The newly added program will be started without restarting/stopping rest of the unchanged programs/processes.