nohup后台运行命令,关闭shell后进程会终止

当用 nohup 执行脚本:
nohup sh /tmp/import_mysql_data.sh &

关闭shell时,再打开shell ,发现进程会退出。

解决办法:
输入exit命令退出终端