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

Nodemon not restarting when using node-java #573

Closed
dannyn-mirth opened this issue Jun 29, 2015 · 7 comments
Closed

Nodemon not restarting when using node-java #573

dannyn-mirth opened this issue Jun 29, 2015 · 7 comments
Labels
stale no activity for 2 weeks

Comments

@dannyn-mirth
Copy link

I posted this issue over at the node-java project: joeferner/node-java#226

In a nutshell, when using node-java, nodemon doesn't start the server after it detects file changes. I thought this was a node-java issue but when I tried out supervisor, it was able to restart the server as it should.

@ezpn
Copy link

ezpn commented Sep 28, 2015

+1

@remy
Copy link
Owner

remy commented Sep 28, 2015

Firstly, I've no clue what node-java is, so you may need to investigate
and fix yourselves. More importantly, are you using the latest nodemon?
Have you also tried in legacy mode?

On Mon, 28 Sep 2015 18:15 Adam Urban [email protected] wrote:

+1


Reply to this email directly or view it on GitHub
#573 (comment).

@tomaskulich
Copy link

+1

happens with nodemon 1.8.1

Some clues what might be happening: Using node-java (and tika in my case), the app does respond to SIGUSR2 signal correctly (I think nodemon somehow assumes / sets that sending SIGUSR2 should kill the app?).

I managed to correct the behavior in my case by adding:

process.once('SIGUSR2', function() {
  process.kill(process.pid, 'SIGUSR2')
})

This needs to be run after I import tika so I think, there is some kind of 'race condition' in what process can react to SIGUSR2 signal; without this snipet, SIGUSR2 is handled by tika not resolving in the exit of the main process.

Also, I tried to quit my code on receiving SIGUSR2:

process.once('SIGUSR2', function() {
  process.exit() // status code 0 or 1 ?
})

but such ending of the process does not cause the nodemon to re-run my app.

@naxmefy
Copy link

naxmefy commented Dec 7, 2016

seems that SIGUSR2 is never called when node-java is there

@camwes
Copy link

camwes commented Oct 5, 2017

@dannyn-mirth I would suggest that this is closed by #1061. As @tomaskulich correctly pointed out the issue is with the signal being passed to node-java. If you use the SIGINT sigint instead the application should terminate normally.
nodemon --signal SIGINT server.js

@naxmefy
Copy link

naxmefy commented Oct 5, 2017

@dannyn-mirth i switched to pm2 (with pm2-dev) for projects with node-java - works absolutly fine - tried every signal from nodemon without luck... cuz node-java seems to need the signal multiple times or sth like dis cya

@stale
Copy link

stale bot commented Dec 5, 2017

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

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

No branches or pull requests

6 participants