B
B
BestJS2017-03-01 10:59:58
System administration
BestJS, 2017-03-01 10:59:58

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

3 answer(s)
C
chupasaurus, 2017-03-01
@BestJS

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.

A
Andrey Mikhalev, 2017-03-01
@Endru9

either create a background process or use screen .

D
Dmitry Shitskov, 2017-03-01
@Zarom

nohup node app.js &

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question