Answer the question
In order to leave comments, you need to log in
Why doesn't nohup work correctly?
I want to start the Node.JS server, but after the terminal is turned off, everything crashes.
The sequence of actions:
1) ssh [email protected] .... .... ....
2) cd /.../.../
3) nohup node app.js
And everything seems to be fine, the background process has started and everything works. But when I close bash the process dies.
Thanks for the help)
Answer the question
In order to leave comments, you need to log in
nohup node app.js > /dev/null 2>&1 &
Without an output redirect, nohup will send the process to the background without unbinding from the shell, with a full redirect, when the shell is closed, the PPID of the running process will change to 1.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question