Browse Source

Force tty (stdin) closed on ssh commands.

Adding the -n to the ssh command forces ssh to redirect stdin from /dev/null
and prevents the remote processes from blocking waiting for user (tty) input.

Change-Id: Ic659c951926e81eacb0db72c6ff0668b5bd38167
changes/41/45241/5
Scott Daniels 5 years ago
parent
commit
9014b2388e
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      inception/utils/cmd.py

+ 1
- 0
inception/utils/cmd.py View File

@@ -77,6 +77,7 @@ def ssh(uri, cmd, screen_output=False, silent=True, agent_forwarding=False):
77 77
         port = 22
78 78
     ## construct flags
79 79
     flags = ['-T']
80
+    flags.append('-n')   # prevent read blocking on tty (stdin)
80 81
     if silent:
81 82
         flags.append('-o StrictHostKeyChecking=no')
82 83
         flags.append('-o UserKnownHostsFile=/dev/null')

Loading…
Cancel
Save