Skip to content
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

Running in not daemon mode #259

Closed
alexbeletsky opened this issue Jan 18, 2014 · 11 comments
Closed

Running in not daemon mode #259

alexbeletsky opened this issue Jan 18, 2014 · 11 comments

Comments

@alexbeletsky
Copy link

I know it may sound a bit silly, but can I run pm2 in not daemon mode?

Let me explain why. I'm working on pm2 plugin for dokku, with dokku each process is started in docker container.

The problem is then I run, pm2 start processes.json it immediately quits, so docker assumes that it's done and stops.

Is that possible to have option like, pm2 start --no-daemon processes.json, so pm2 continues to run?

@Unitech
Copy link
Owner

Unitech commented Jan 21, 2014

#113

Yes would be interesting. Changing the way pm2 launch itself would be a quite big work.
An alternative would be to not exit ? And instead printing on the standard output the pid of the pm2 daemon ?

I know it's not very elegant but could it solve this problem ?

@alexbeletsky
Copy link
Author

It would solve the problem, +1 for that change.

@NodexTech
Copy link

+1 For this - docker is gaining traction now

@alexbeletsky
Copy link
Author

Want to follow-up on that.. So, no-deamon option is merged now, can this issue be closed?

@aikomastboom
Copy link

How do I tell pm2 to also send stdout/stderr of its managed processes to the console?

currently when I start pm2 --no-deamon, only the pm2.log seems to be shown, not the logs of the process I just started.

@Unitech
Copy link
Owner

Unitech commented May 7, 2015

you can do

$ pm2 start app.js
$ pm2 logs

We just fixed the --no-daemon command to also display processes output f4569cb

@aikomastboom
Copy link

excellent, thank you.

@lexoyo
Copy link

lexoyo commented Jun 22, 2016

Hello
It seems that when I start pm2 with --no-daemon it does not send data to keymetrics anymore... Am I right?

@lexoyo
Copy link

lexoyo commented Jun 22, 2016

False alarm sorry about that, no problem

@Fenchurchh
Copy link

Fenchurchh commented Aug 12, 2017

Just incase somebody googles this thread.
As of 2017 pm2-docker runs in --no-daemon mode instead of pm2

http://pm2.keymetrics.io/docs/usage/docker-pm2-nodejs/

@ghost
Copy link

ghost commented Jul 26, 2018

pm2-docker was renamed to pm2-runtime but should still work as pm2-docker for now

https://pm2.io/doc/en/runtime/integration/docker/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants