fabric 支持在linux环境nohup后台运行吗? IOError: [Errno 9] Bad file descriptor

 

运行报错

nohup ./upload_shell.sh 20161216 20161216 &

 

问题

Traceback (most recent call last):
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/main.py", line 756, in main
    *args, **kwargs
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/tasks.py", line 426, in execute
    results[''] = task.run(*args, **new_kwargs)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/tasks.py", line 173, in run
    return self.wrapped(*args, **kwargs)
  File "/home/liukaisheng/env/bin/online/192.168.12.6/upload_log_to_oas.py", line 87, in backup_data
    execute(backup,date)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/tasks.py", line 386, in execute
    multiprocessing
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/tasks.py", line 276, in _execute
    return task.run(*args, **kwargs)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/tasks.py", line 173, in run
    return self.wrapped(*args, **kwargs)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/decorators.py", line 56, in inner_decorator
    return func(*args, **kwargs)
  File "/home/liukaisheng/env/bin/online/192.168.12.6/upload_log_to_oas.py", line 117, in backup
    if not exists(src_path + file_name):
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/contrib/files.py", line 33, in exists
    cmd = 'stat %s' % _expand_path(path)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/contrib/files.py", line 466, in _expand_path
    return path if is_win() else '"$(echo %s)"' % path
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/contrib/files.py", line 453, in is_win
    return '"' in run('echo "Will you echo quotation marks"')
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/network.py", line 683, in host_prompting_wrapper
    return func(*args, **kwargs)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/operations.py", line 1090, in run
    shell_escape=shell_escape, capture_buffer_size=capture_buffer_size,
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/operations.py", line 933, in _run_command
    capture_buffer_size=capture_buffer_size)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/operations.py", line 815, in _execute
    worker.raise_if_needed()
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/thread_handling.py", line 12, in wrapper
    callable(*args, **kwargs)
  File "/home/liukaisheng/env/lib/python2.7/site-packages/fabric/io.py", line 231, in input_loop
    byte = msvcrt.getch() if win32 else sys.stdin.read(1)
IOError: [Errno 9] Bad file descriptor

 

解决

nohup ./upload_shell.sh 20161216 20161216  < /dev/null & 

你可能感兴趣的:(fabric,linux,运维)