Bug 977952 - RFE: disable all direct writes to the console
Summary: RFE: disable all direct writes to the console
Alias: None
Product: Fedora
Classification: Fedora
Component: cloud-init
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Garrett Holmstrom
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-25 16:22 UTC by Matthew Miller
Modified: 2013-10-18 19:54 UTC (History)
7 users (show)

Fixed In Version: cloud-init-0.7.2-7.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-10-18 19:54:30 UTC
Type: Bug

Attachments (Terms of Use)

Description Matthew Miller 2013-06-25 16:22:54 UTC
cloud-init has code which opens /dev/console directly and writes output to it. This causes two problems:

1. Utter failure of cloud-init if the console device happens to not exist
2. Messages interspersed randomly with other console output

The former is a problem when attempting to ship one cloud image which works in multiple environments. The latter is a problem if one is hoping to mine the output for machine-parseable info -- it could be corrupt.

I think the solution here is to tell cloud-init to never open /dev/console. I think this is most easily achieved with the big hammer of patching out the /dev/console bit from the multi_log function in ./cloudinit/util.py, but am open to more elegant solutions.

_Then_, we do one of the following:

A. Use StandardOutput=syslog+console in the systemd service files (and actually remove the log call in multi_log as well)


B. Use the systemd option to write _all_ journal log data to the console.

"A" is the more narrow solution, of course. "B" would result in much more information being written to the console and thus available through API calls.

Comment 1 Garrett Holmstrom 2013-09-20 02:13:06 UTC
I replaced multi_log's writes to /dev/console with simple print statements that go to stdout and switched the .service files over to StandardOutput=journal+console (syslog continues to be more verbose and handled normally), but messages don't actually appear to show up on the console unless the one appropriate for the cloud in question happens to be the last one on the kernel command line.  F20 alpha RC 3 puts console=tty0 last, so EC2 sees no cloud-init output at all unless I swap that with console=hvc0.

Do you happen to know if this is a systemd thing or a linux thing?

Comment 2 Matthew Miller 2013-09-20 12:48:21 UTC
That is a linux thing. I think we need to figure out how to put hvc0 last for EC2.

Actually, although it's pretty super-ugly, I know one way -- put hvc0 there for pvgrub, and use tty0 for syslinux. At least for EC2 -- does that help at all in Eucalyptus?

Comment 3 Fedora Update System 2013-09-25 02:41:37 UTC
cloud-init-0.7.2-6.fc20 has been submitted as an update for Fedora 20.

Comment 4 Fedora Update System 2013-09-25 02:42:57 UTC
cloud-init-0.7.2-6.fc19 has been submitted as an update for Fedora 19.

Comment 5 Fedora Update System 2013-09-27 00:44:25 UTC
Package cloud-init-0.7.2-7.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cloud-init-0.7.2-7.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-09-27 01:19:54 UTC
cloud-init-0.7.2-7.fc18 has been submitted as an update for Fedora 18.

Comment 7 Fedora Update System 2013-10-15 06:28:39 UTC
cloud-init-0.7.2-7.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-10-18 19:46:14 UTC
cloud-init-0.7.2-7.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2013-10-18 19:54:30 UTC
cloud-init-0.7.2-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.