~cloud-init-dev/cloud-init/trunk

Viewing all changes in revision 873.

  • Committer: Scott Moser
  • Date: 2013-09-25 18:52:55 UTC
  • mfrom: (870.2.3 nodevconsole)
  • Revision ID: smoser@ubuntu.com-20130925185255-f8mhoatcls9ier40
multi_log: only write to /dev/console if it exists.

Some containers lack /dev/console, so when multi_log attempts to open
that device and write to it directly things can start going haywire.

Here we address this problem by sending console-bound output to stdout
and letting init take care of getting it to the console instead.
We already configure upstart with "console output", so we need only
change systemd to use "journal+console".

The one reason that 'console output' might not be sufficient is if
the user redirected output with 'output'.  Ie:
  output:
    init: "> /var/log/my-cloud-init.log"

Would then mean all output would go there, and anything that
*needed* to go to the console (and was explicitly using multi_log for
that purpose) would not get there.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: