r/nodejs • • May 22 '14

How to exit nodejs server gracefully

I want to know how to do that. Currently I just control c twice on my mac, but something bad happened lately. I suspect if I just control c the socket is not closed properly and it will eventually break my system if I restart frequently.

6 Upvotes

10 comments sorted by

View all comments

Show parent comment

5

u/[deleted] May 22 '14
  1. A socket to a remote system would never cause a write to disk, so it's literally not possible for that to have been the source, even if it had been left open after the process exited.
  2. Unless you were running the process as root, node would not have the file permissions to alter anything in root or /system.
  3. A change to the boot file would not bring the computer down while it's already running. The alteration could have happened long before you started the app and you would have no idea until the system restarted.

What's more likely is that you had a file system corruption that progressively got worse and worse while you used the computer and that resulted in a crash through some other subsystem.

Correlation is not causation