如何在没有标准配置的情况下启动结构任务



我有很多任务需要使用另一个shell脚本启动。

我想使用 nohup 模式运行 shell 脚本,但结构拒绝继续,因为没有标准

Traceback (most recent call last):
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/main.py", line 743, in main
        *args, **kwargs
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/tasks.py", line 368, in execute
        multiprocessing
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/tasks.py", line 264, in _execute
        return task.run(*args, **kwargs)
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/tasks.py", line 171, in run
        return self.wrapped(*args, **kwargs)
      File "/home/ubuntu/utils/deploy_to_ubuntu/deploy_worker.py", line 84, in deploy_existing
        run('sudo sh ~/existing_setup.sh')
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/network.py", line 578, in host_prompting_wrapper
        return func(*args, **kwargs)
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/operations.py", line 1042, in run
        shell_escape=shell_escape)
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/operations.py", line 911, in _run_command
        stderr=stderr, timeout=timeout)
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/operations.py", line 795, in _execute
        worker.raise_if_needed()
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/thread_handling.py", line 12, in wrapper
        callable(*args, **kwargs)
      File "/home/user/local/lib/python2.7/site-packages/Fabric-1.8.0-py2.7.egg/fabric/io.py", line 215, in input_loop
        byte = msvcrt.getch() if win32 else sys.stdin.read(1)
    IOError: [Errno 9] Bad file descriptor

我不需要任何终端的 stdin。

我正在使用--no-pty选项在 shellscript 中运行织物,但它根本没有帮助

根本不可能不运行此nohup模式,因为它大约需要10个小时,我不希望终端打开这么长时间。

shellscript 看起来像这样:

fab --no-pty deploy.add_new_server
python runtests.py
python add_another_server_to_config.py
fab --no-pty deploy.add_new_server
python runtests.py
.
.
.

我跑nohup deploy_and_test.sh &

这很简单。

 nohup deploy_and_test.sh </dev/null &

相关内容

最新更新