[Solution] Use the nohup & command to run the shell script, close the terminal and still exit

Nohup sometimes has problems: when the terminal is closed, the process will be closed automatically, check nohup.out, you can see that the service is automatically closed when the terminal is closed.
There is a detail when operating the terminal: when the shell prompts that nohup is successful, you need to press any key on the keyboard to return to the shell input command window, and then exit the terminal by typing exit in the shell; and I execute it every time in nohup After success, click the close program button to close the terminal. Therefore, the session corresponding to the command will be disconnected at this time, causing the process corresponding to nohup to be notified that it needs to be shut down together.

Guess you like

Origin blog.csdn.net/nbcsdn/article/details/106543426