Nodemon: Nodemon not restarting when using node-java

Created on 29 Jun 2015  Â·  7Comments  Â·  Source: remy/nodemon

I posted this issue over at the node-java project: https://github.com/joeferner/node-java/issues/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.

stale

Most helpful comment

@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

All 7 comments

+1

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
https://github.com/remy/nodemon/issues/573#issuecomment-143807993.

+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.

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

@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

@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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dimsmol picture dimsmol  Â·  4Comments

fabianMendez picture fabianMendez  Â·  4Comments

Bastorx picture Bastorx  Â·  5Comments

medoix picture medoix  Â·  4Comments

Autre31415 picture Autre31415  Â·  4Comments