summaryrefslogtreecommitdiff
path: root/cloud-init-run-module.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-12-19 17:02:54 -0500
committerScott Moser <smoser@ubuntu.com>2011-12-19 17:02:54 -0500
commit4ee421211816b9f40e09585137b42a8fcec42218 (patch)
treed5efa8c2ff18787639f3910e412fcab1d34618cb /cloud-init-run-module.py
parent02c2e024a3ae57879faee82218fde7db19831efc (diff)
parent0bc89a7290453f4a496358e90d807c3616518273 (diff)
downloadvyos-cloud-init-4ee421211816b9f40e09585137b42a8fcec42218.tar.gz
vyos-cloud-init-4ee421211816b9f40e09585137b42a8fcec42218.zip
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. LP: #903993
Diffstat (limited to 'cloud-init-run-module.py')
-rwxr-xr-xcloud-init-run-module.py2
1 files changed, 2 insertions, 0 deletions
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
# <freq> <semaphore-name> <module-name> args
if len(sys.argv) < 4: