From 0bc89a7290453f4a496358e90d807c3616518273 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 19 Dec 2011 17:01:07 -0500 Subject: make stdin read from /dev/null for all cloud-init programs (LP: #903993) the cloud-init programs are never intended to run interactively. Some programs were being run via subprocess, and would notice that their input was attached to a terminal (/dev/console). As a result, they they would try to prompt the user for input (apt-add-repository) This change simply re-opens standard input as /dev/null so any subprocesses will not end up blocking on input. --- cloud-init-run-module.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cloud-init-run-module.py') diff --git a/cloud-init-run-module.py b/cloud-init-run-module.py index 1bb99698..b360d06d 100755 --- a/cloud-init-run-module.py +++ b/cloud-init-run-module.py @@ -25,6 +25,8 @@ def Usage(out = sys.stdout): out.write("Usage: cloud-init-run-module freq sem-name mod-name [args]\n") def main(): + util.close_stdin() + # expect to be called with # args if len(sys.argv) < 4: -- cgit v1.2.3