logging of init doesn't go to console

Bug #1049926 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

REL=quantal
ARCH=$(dpkg --print-architecture)
NAME=$REL-$ARCH

sudo lxc-create -t ubuntu-cloud -n $NAME -- --release=$REL --arch=$ARCH --stream=daily

sudo lxc-start --name=$NAME -- /sbin/init --verbose

# the above will not show output of upstart

you can fix/hack this by:
sudo ln -sf console /var/lib/lxc/${NAME}/rootfs/dev/kmsg

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu33
ProcVersionSignature: User Name 3.5.0-14.15-generic 3.5.3
Uname: Linux 3.5.0-14-generic x86_64
ApportVersion: 2.5.1-0ubuntu7
Architecture: amd64
Date: Wed Sep 12 15:55:28 2012
Ec2AMI: ami-0000014b
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug.

Ideally '-- /sbin/init --verbose console=/dev/console' would work (passing the output to /dev/console which is a symbolic link to /dev/lxc/console, which is a bind mount of the proper devpts pty).

Changed in lxc (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

When you say

    sudo ln -sf console /var/lib/lxc/${NAME}/rootfs/dev

the source is a relative pathname. This should end up with a link to itself. (it also doesn't work for me) Can you tell me what directory you are in when you do that, and what 'ls -l /var/lib/lxc/quantal-amd64/rootfs/dev' shows for you?

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 1049926] Re: logging of init doesn't go to console

On Wed, 12 Sep 2012, Serge Hallyn wrote:

> When you say
>
> sudo ln -sf console /var/lib/lxc/${NAME}/rootfs/dev
>
> the source is a relative pathname. This should end up with a link to
> itself. (it also doesn't work for me) Can you tell me what directory
> you are in when you do that, and what 'ls -l /var/lib/lxc/quantal-
> amd64/rootfs/dev' shows for you?

Sorry, bad cut and paste.
  sudo ln -sf console /var/lib/lxc/${NAME}/rootfs/dev/kmsg

Scott Moser (smoser)
description: updated
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Ah, thanks, that makes sense.

That seems like a sensible workaround until container syslog is supported.

Changed in lxc (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu34

---------------
lxc (0.8.0~rc1-4ubuntu34) quantal; urgency=low

  [ Serge Hallyn ]
  * 0214-give-pclose-errno: help debug pclose failures when lxc runs scripts.
  * 0215-lxc-clone-name-arg: fix incorrect checking for --name argument.
    (LP: #1049914)
  * 0216-hook-kmsg-to-console: link /dev/kmsg to /dev/console so init log
    messages can be seen. (LP: #1049926)
  * 0217-lxc-clone-fix-fstab: fix check for lxc.mount in lxc-clone
    (LP: #1049987)
  * 0218-api-shutdown-fix-doublestop: don't call c->stop() when already
    stopped (LP: #1050001)
  * Update lxc-start-container apparmor abstraction to allow ecryptfs mounts
    from the pre-mount script. Remove the instruction to add that line from
    the example hook.
  * Update lxc-start-container apparmor abstraction to allow mounts to paths
    under /var/lib/lxc/$container/, so that pre-mount hooks can stage mounts
    there. Also update the mountecryptfs example premount hook to use that.
    (LP: #1050469)
  * debian/rules: remove parsing of apparmor.in files.

  [ Stéphane Graber ]
  * Update lxc-start-container apparmor abstraction to allow aufs and overlayfs
    mounts from the pre-mount scripts. This is required by some hooks and will
    be needed by the new lxc-start-ephemeral.
  * Remove multi-arch path in lxc-start-container apparmor abstraction and
    instead just allow /usr/lib/*/lxc/ so nested containers running on a
    different architecture don't get blocked by apparmor.
  * Cherry-pick python-lxc fixes from upstream:
    - Minor PEP-8 syntax fix
    - Return an exception when getting Container instance as non-root
    - Automatically convert any state string passed to wait() to its uppercase
      equivalent.
    - Replace test.py by a full example of the API.
    - Remove zombie handler function from C module as it's no longer required
      and causes weird bugs when used with the hooks.

  [ William Grant ]
  * lxc-start-ephemeral: exit with the command's status, not always 0.
    (LP: #1050351)
 -- Serge Hallyn <email address hidden> Thu, 13 Sep 2012 12:02:45 -0500

Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.