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

PM2 does not "watch" (respond to file changes) on Ubuntu 14.04.1 LTS #1449

Closed
tkambler opened this issue Jul 20, 2015 · 9 comments
Closed

PM2 does not "watch" (respond to file changes) on Ubuntu 14.04.1 LTS #1449

tkambler opened this issue Jul 20, 2015 · 9 comments

Comments

@tkambler
Copy link

Example app - https://dl.dropboxusercontent.com/u/832215/app.zip

When I start this application on OS X (Yosemite), it works just fine:

$ pm2 start ./pm2/development.json

As changes are made to files within ./lib/**/*, the application automatically restarts. However, when I start the application on Ubuntu 14.04.1 LTS - it starts just fine, but does not respond to file changes. Quite frustrating.

@tkambler
Copy link
Author

This is really strange... when I set the DEBUG env variable to * and then launch, PM2 behaves as desired:

$ export DEBUG=* && pm2 start ./pm2/development.json

@tkambler
Copy link
Author

Or so it seemed. I'm honestly not sure at this point. For me, watch functionality is extremely finicky and unreliable right now.

@tkambler
Copy link
Author

So again, I was able to start the app and have watch do absolutely nothing. I then ran $ pm2 kill, export DEBUG=*, and pm2 start ./pm2/development.json, and it started working again. I then ran $ pm2 kill && export DEBUG= && pm2 start ./pm2/development.json - and now watch no longer works.

@soyuka
Copy link
Collaborator

soyuka commented Jul 21, 2015

Please edit your post next time instead of mass-posting like this, thanks.

First, there are issues regarding Ubuntu 14.04: #1424 #1380.

So, please try the development version npm i -g Unitech/PM2#development.

Or so it seemed. I'm honestly not sure at this point. For me, watch functionality is extremely finicky and unreliable right now.

Saying this is an easy task, but I can assure you that the only issues there are with the watch functionnality are cases that are not covered by chokidar (see nfs for example). The only thing done here is to enable chokidar when a flag is set, nothing more!

Can you mention: pm2 version, node version, some head -n 50 ~/.pm2.log. You may also want to take a look at contributing guidelines and this issue about watch that expose some solutions to problems.

@soyuka soyuka added the waiting label Jul 22, 2015
@Unitech
Copy link
Owner

Unitech commented Jul 24, 2015

Hello @tkambler,

Do the new version of PM2 solved your issue?

The update procedure is quite simple:

$ npm install pm2 -g
$ pm2 update

Thanks,

@tkambler
Copy link
Author

It did. What was the problem?

@soyuka
Copy link
Collaborator

soyuka commented Jul 24, 2015

Probably the ubuntu segfault caused by the garbage collector.

Commit about the fix here. See also #1380 and this issue on joyent/node.

@soyuka soyuka closed this as completed Jul 24, 2015
@Unitech
Copy link
Owner

Unitech commented Jul 24, 2015

Happy to hear that!

@nojvek
Copy link

nojvek commented Sep 3, 2017

I am experiencing the watching issue on 16.04

It seems node 8.4 doesn't bode well with 16.04

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

node -v
v8.4.0

pm2 -v
2.6.1

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

4 participants