After nohup & exits the shell terminal, the service is still disconnected

When learning the vue project, use nohup to start in the background, and the service is still killed after disconnecting the shell terminal.

nohup yarn serve --host 0.0.0.0 --port 8080 > logs.log 2>&1 &

Some programs can be executed normally in the background by directly using nohup, but when Vue is started, it will be killed when the shell is disconnected. The specific reason is unknown.

solution:

After executing the nohup command, do not close the shell window directly. Execute exit first, and then close the shell window.

Nohup learning blog post:  Detailed explanation of Linux nohup command usage_Detailed explanation of nohup usage

Guess you like

Origin blog.csdn.net/weixin_44799217/article/details/131486861