Process Manager - crazedsanity/webcron GitHub Wiki

What is the "Process Manager"?

It's a PHP script that runs a given command-line process and monitors it for output, errors, and it's exit code. This process does not natively log anything do a database nor any log file.

Invoking a process manager looks like this:

/usr/bin/php ./cli_wrapper.php "" /bin/false arg1...

The parts of this script are:

  1. the PHP interpreter (to run the PHP script): /usr/bin/php (the location may vary, it should be safe to leave the path out as well).
  2. the CLI wrapper script: ./cli_wrapper.php
  3. arguments for the CLI wrapper (currently unused): ""
  4. the program itself: /bin/false
  5. the program's arguments: arg1...

Everything after the CLI wrapper's arguments is the program and any arguments needed for it to run. So, if the automated reporting program (example) were to normally be invoked as /usr/local/bin/sendreport.pl -weekly, then consider the change:

BEFORE:

/usr/local/bin/sendreport.pl -weekly

AFTER:

php ./cli_wrapper.php "" /usr/local/bin/sendreport.pl -weekly