【问题标题】:nohup command could not generate the nohup.out file by rundeck jobnohup 命令无法通过 rundeck 作业生成 nohup.out 文件
【发布时间】:2015-08-25 05:43:58
【问题描述】:

我的 rundeck 作业执行一个简单的 nohup 命令“cd /tmp/; nohup ls -l &”。作业执行日志会得到命令输出,但不会在该目录中生成 nohup.out 文件。

我在 rundeck 工作流程中使用了所有类型的步骤。 all 无法生成 nohup.out 文件。

有人知道为什么rundeck 无法生成nohup.out 文件而是将命令输出发送到执行日志吗?谢谢

【问题讨论】:

    标签: nohup rundeck


    【解决方案1】:

    您似乎没有将输出重定向到文件,根据我的经验,nohup 在 RunDeck 中运行良好。

    cd /tmp/; nohup ls -l > /tmp/nohup.something
    

    【讨论】:

      【解决方案2】:

      我有一个可行的理论:nohup 正在被 Rundeck 基础架构使用/解释,并大致解释为:“在后台无限期运行此作业”,而我们通常不理解“输出到非 tty”(即 stdout/stderr 到 nohup.out 或一起通过管道传输到文件)。或者至少,我相当肯定它没有执行我路径上的 nohup 版本。

      因此:

      1. 您应该手动将所有输出(stdout 和 stderr)重定向到文件,除非您愿意让 Rundeck 捕获它
      2. 你不需要&,虽然它不会伤害任何东西

      就我而言,我翻译自:

      cd tools/celery && nohup ./start.sh flower > log_name.txt &
      

      到:

      cd tools/celery && nohup ./start.sh flower > log_name.txt 2>&1
      

      【讨论】:

        猜你喜欢
        • 2023-02-08
        • 2021-08-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-12-22
        • 1970-01-01
        • 2023-01-04
        • 1970-01-01
        相关资源
        最近更新 更多