linux - nohup 进程显示在 ps 中但不在 top 中

标签 linux bash nohup ps

我运行了一个 python 脚本,如 script.py 如下:

nohup python3 script.py &

现在,我获得了一个进程 ID,并出现以下消息:

$  nohup: ignoring input and appending output to 'nohup.out'

现在我尝试查看top,它显示python3一段时间,然后就不再显示了。使用ps命令最终显示了该过程。因此,我使用进程 ID 来终止它(我认为这可以克服挂起问题)。然后我又 使用nohup命令。但同样的事情又发生了。

发生这种情况可能是因为我未能克服 nohup 挂起问题。这意味着我之前已经运行过这个命令,现在我需要重新对齐 nohup 的流。 (参见this)

我的问题是,我现在应该做什么? nohup 仍然挂起,我无法在后台运行命令。如有任何帮助,我们将不胜感激。

最佳答案

我认为这个问题是因为您使用了 & 运算符而产生的。 & gone 命令到后台并将其设置为空闲命令。

关于linux - nohup 进程显示在 ps 中但不在 top 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53112929/

相关文章:

c - 在 C 中获取当前按下的键?

linux - 如何让一个程序用户在打开PC时直接进入?

bash - 理解 tty + bash

linux - 使用脚本更改用户的主要和次要组

linux - 如何将内容回显到 Linux 中子文件夹中的每个文件?

linux - 如何使用 nohup 通过 ssh 在远程服务器上执行本地 bash 脚本

ruby-on-rails - 使用Capistrano启动后台任务

linux - 如何让 Subversion 使用第三方差异工具?

linux - 通过电子邮件发送 SSL 证书是否安全?

linux - 狂欢 : how to use a function (which is a string param) in an other function