New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pm2 attach <pm_id> #2968
Comments
|
Published on PM2 2.6.0: $ npm install pm2@latest -g
$ pm2 update
$ pm2 attach 0 |
|
was this feature removed? I can’t find it in the docs edit: nevermind, found this file |
I'm getting this error when using npm prompt - which requests input from stdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allow to attach to a process stdin (and stdout) in order to send commands.
This is very useful when you have implemented a kind of CLI in an application (IoT, electronic...).
How we fork a process:
https://github.com/Unitech/pm2/blob/master/lib/God/ForkMode.js#L94
Potential solution
Use Node.js readline via
pm2 attach <proc_id>
and at every new command (separated by a \n), send to PM2 daemon method that will do a `God.clusters_db[pm_id].stdin.write(CMD)@vmarchaud thoughts?
The text was updated successfully, but these errors were encountered: