summaryrefslogtreecommitdiff
path: root/cloud-init-cfg.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-12-19 17:01:07 -0500
committerScott Moser <smoser@ubuntu.com>2011-12-19 17:01:07 -0500
commit0bc89a7290453f4a496358e90d807c3616518273 (patch)
tree87658e955a347cbf9f4537ad1a2ec21d0353b064 /cloud-init-cfg.py
parent02c2e024a3ae57879faee82218fde7db19831efc (diff)
downloadvyos-cloud-init-0bc89a7290453f4a496358e90d807c3616518273.tar.gz
vyos-cloud-init-0bc89a7290453f4a496358e90d807c3616518273.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.
Diffstat (limited to 'cloud-init-cfg.py')
-rwxr-xr-xcloud-init-cfg.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cloud-init-cfg.py b/cloud-init-cfg.py
index 0905eb5e..de221ec7 100755
--- a/cloud-init-cfg.py
+++ b/cloud-init-cfg.py
@@ -35,6 +35,8 @@ def main():
# read cloud config jobs from config (builtin -> system)
# and run all in order
+ util.close_stdin()
+
modename = "config"
if len(sys.argv) < 2: