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 persists after terminal is closed #1949

Closed
sguillia opened this issue Nov 4, 2021 · 2 comments
Closed

nodemon persists after terminal is closed #1949

sguillia opened this issue Nov 4, 2021 · 2 comments

Comments

@sguillia
Copy link

sguillia commented Nov 4, 2021

  • Versions: node@v14.3.0, linux@4.15.0-142-generic
  • nodemon -v: 2.0.14
  • Operating system/terminal environment (powershell, gitshell, etc): zsh
  • Using Docker? What image:
  • Command you ran:
# In terminal 1
touch empty-file.js
nodemon empty-file.js

# In terminal 2 (replace $PID by nodemon PID)
kill -HUP $PID

Expected behaviour

nodemon did exit

Actual behaviour

nodemon is still running

Steps to reproduce

See above


Any normal linux process is terminated when its terminal is closed. Except nodemon.

This project's readme advertises automatic restarting, but not SIGHUP immunity. Not knowing this leads to hard-to-debug issues like this one.

Is this behavior documented? Is there a rationale behind it? Is there a flag to disable it?
Thank you!

@remy
Copy link
Owner

remy commented Nov 4, 2021

nodemon uses the HUP signal to restart the sub process:

$ nodemon -V empty.js
[nodemon] 2.0.14
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 52589 to restart
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node empty.js`
[nodemon] forking
[nodemon] child pid: 52592

So when you send HUP to nodemon, it's handling the signal.

@remy remy closed this as completed Nov 4, 2021
@Rinzwind
Copy link

Rinzwind commented Jul 1, 2022

For anyone else having this issue: further discussion is in issues #1667 and #1705.

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

3 participants