summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/util.py10
-rw-r--r--systemd/cloud-config.service2
-rw-r--r--systemd/cloud-final.service2
-rw-r--r--systemd/cloud-init-local.service2
-rw-r--r--systemd/cloud-init.service2
5 files changed, 9 insertions, 9 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index d50d3e18..02890448 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -360,11 +360,11 @@ def multi_log(text, console=True, stderr=True,
if stderr:
sys.stderr.write(text)
if console:
- # Don't use the write_file since
- # this might be 'sensitive' info (not debug worthy?)
- with open('/dev/console', 'wb') as wfh:
- wfh.write(text)
- wfh.flush()
+ # Some containers lack /dev/console, so we send output to
+ # stdout and configure upstart with "console output" and
+ # systemd with "journal+console" and let them take care of
+ # getting output to the console.
+ print text
if log:
if text[-1] == "\n":
log.log(log_level, text[:-1])
diff --git a/systemd/cloud-config.service b/systemd/cloud-config.service
index fc72fc48..41a86147 100644
--- a/systemd/cloud-config.service
+++ b/systemd/cloud-config.service
@@ -11,7 +11,7 @@ RemainAfterExit=yes
TimeoutSec=0
# Output needs to appear in instance console output
-StandardOutput=tty
+StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
diff --git a/systemd/cloud-final.service b/systemd/cloud-final.service
index f836eab6..ef0f52b9 100644
--- a/systemd/cloud-final.service
+++ b/systemd/cloud-final.service
@@ -11,7 +11,7 @@ RemainAfterExit=yes
TimeoutSec=0
# Output needs to appear in instance console output
-StandardOutput=tty
+StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service
index 6a551710..a31985c6 100644
--- a/systemd/cloud-init-local.service
+++ b/systemd/cloud-init-local.service
@@ -10,7 +10,7 @@ RemainAfterExit=yes
TimeoutSec=0
# Output needs to appear in instance console output
-StandardOutput=tty
+StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service
index d4eb9fa5..018a1fa8 100644
--- a/systemd/cloud-init.service
+++ b/systemd/cloud-init.service
@@ -11,7 +11,7 @@ RemainAfterExit=yes
TimeoutSec=0
# Output needs to appear in instance console output
-StandardOutput=tty
+StandardOutput=journal+console
[Install]
WantedBy=multi-user.target