【问题标题】:Run Bash Script in New Process Tree [duplicate]在新进程树中运行 Bash 脚本 [重复]
【发布时间】:2018-01-16 16:57:57
【问题描述】:

我正在使用一个复杂的 bash 脚本,该脚本执行各种操作并重新启动运行它的 Linux (CentOS 6) 服务器。这个脚本是从几个不同的地方调用的。 我正在寻找一种在新进程树中启动执行此复杂 bash 脚本的方法

我整理了下面的文字图来说明这个场景:

a_process_that_calls_script
 \_ subshells/processes/commands_of_calling_process
...
bash_script
 \_ subshells/commands/other_scripts_called

【问题讨论】:

    标签: linux bash


    【解决方案1】:

    可能重复:How can I launch a new process that is NOT a child of the original process?

    如果您有一个进程将脚本作为孙进程调用,然后子进程退出,则孙进程将成为 init 进程的子进程。

    【讨论】:

      猜你喜欢
      • 2011-02-23
      • 2019-01-05
      • 2019-06-24
      • 1970-01-01
      • 1970-01-01
      • 2010-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多