Google 云 shell 这样进程在注销时继续

Google cloud shell so that the process continues when logged out

我使用来自 google 云的 shell 或 vps,每次退出时我想 运行 这个 shelll 中的一个进程shell 中的进程也停止或死亡。 我使用了 SCREENTMUX 命令,当我离开 shell 20 分钟后,进程自行关闭。 可以请教高手吗?

简短地回答您的问题:这是不可能的。

更详细的,您需要了解什么是 Cloud Shell:它是一个微型 VM,google 可以为您自由启动。您每周有配额并且 VM 至少每 12 小时重启一次

Non-interactive usage: Cloud Shell is intended for interactive use only. Non-interactive sessions will be ended automatically after a warning. Note that Cloud Shell sessions are capped at 12 hours, after which sessions are automatically terminated. You can use a new session immediately after.

当您未与云 Shell 控制台交互时,它会在 20 分钟后自动停止。为什么?为了节省资源和金钱(在 Google 方面),因为您不支付此计算资源。

您在 documentation

中有关于云 Shell 环境限制的更多详细信息

无论如何,如果您想 运行 一个批处理作业,在像 Cloud Shell 这样的小型 VM 上,您可以为此使用 the Free tier 计算引擎实例。 (选择正确的地区,否则你会付出代价!)