可能的重复:
如何分叉一个在 shell 退出时不会死亡的进程?
有时我使用 NX 远程连接到我的 Ubuntu。然后我在后台运行一些作业,例如:
$ /path/to/script.pl &
Run Code Online (Sandbox Code Playgroud)
但是,当我注销时,作业停止运行。
即使我注销后如何才能让它们继续?
是否可以将 upstart 启动的进程置于前台?
root@me:~# ps aux | grep my-app
root 2208 0.2 0.0 1456 480 ? S 17:38 0:01 /opt/me/my-app
root@me:~# fg 2208
-bash: fg: 2208: no such job
root@me:~# fg $(pidof my-app)
-bash: fg: 2208: no such job
Run Code Online (Sandbox Code Playgroud)