Garrett Holmstrom 2013-09-20 16:22:34 -07:00
parent f048ee2476
commit 1b39f6bbcf
2 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,73 @@
Index: cloud-init-0.7.2/cloudinit/util.py
===================================================================
--- cloud-init-0.7.2.orig/cloudinit/util.py
+++ cloud-init-0.7.2/cloudinit/util.py
@@ -361,11 +361,11 @@ def multi_log(text, console=True, stderr
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])
Index: cloud-init-0.7.2/systemd/cloud-config.service
===================================================================
--- cloud-init-0.7.2.orig/systemd/cloud-config.service
+++ cloud-init-0.7.2/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
Index: cloud-init-0.7.2/systemd/cloud-final.service
===================================================================
--- cloud-init-0.7.2.orig/systemd/cloud-final.service
+++ cloud-init-0.7.2/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
Index: cloud-init-0.7.2/systemd/cloud-init-local.service
===================================================================
--- cloud-init-0.7.2.orig/systemd/cloud-init-local.service
+++ cloud-init-0.7.2/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
Index: cloud-init-0.7.2/systemd/cloud-init.service
===================================================================
--- cloud-init-0.7.2.orig/systemd/cloud-init.service
+++ cloud-init-0.7.2/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

View File

@ -20,6 +20,13 @@ Patch0: cloud-init-0.7.2-fedora.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1008250
Patch1: cloud-init-0.7.2-puppetagent.patch
# Send text to stdout instead of /dev/console, then tell systemd to send
# stdout to journal+console. Code that sends directly to syslog remains
# unchanged.
# https://bugzilla.redhat.com/show_bug.cgi?id=977952
# https://bugs.launchpad.net/bugs/1228434
Patch2: cloud-init-0.7.2-nodevconsole.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -58,6 +65,7 @@ ssh keys and to let the user run various scripts.
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
cp -p %{SOURCE2} README.fedora
@ -140,6 +148,7 @@ fi
%changelog
* Fri Sep 20 2013 Garrett Holmstrom <gholms@fedoraproject.org> - 0.7.2-5
- Fixed puppet agent service name [RH:1008250]
- Let systemd handle console output [RH:977952 LP:1228434]
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild