joe-at-startupmedia / pmon3

Golang Production Process Manager
10 stars 0 forks source link

provide the ability for an interpreter #21

Closed joe-at-startupmedia closed 6 months ago

joe-at-startupmedia commented 6 months ago

Currently pmond assumes the first (and only) argument of the exec cmd is a binary. pmon3 does not allow multiple arguments for the exec cmd. This makes the process manager only usable with binaries. Scripts cannot be executed which require the following format:

/usr/local/bin/node /path/to/node/app.js

A work around is creating a bash script to do the same :

#!/bin/bash
/usr/local/bin/node /path/to/node/app.js

And then executing that using pmon3 exec

The problem is that pmon3 only accounts resources usage for that of the bash script and not the resulting child process.

pm2 allows an interpreter flag and/or automatically handles execution of scripts using the proper interpreter

joe-at-startupmedia commented 6 months ago

Not necessary. The proper way to do this is using the "interpreter" as the program name and the script as a value provided to the --args command:

pmon3 exec /usr/local/bin/node --args "/path/to/node/app.js" --name=app