/etc/lsb-base-logging.sh causes some initscripts to abort if console is unavailable

Bug #104371 reported by Daniel Pittman
8
Affects Status Importance Assigned to Milestone
lsb (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Feisty by Daniel Pittman

Bug Description

Binary package hint: lsb

I have been working on getting Ubuntu Feisty running inside an OpenVZ VE -- a virtualized environment that runs an unmodified Linux distribution in a "chroot on steroids."

In this environment, by default, /dev/console is not accessible -- attempts to open in fail with EPERM. In the event that access is granted to the device node they fail with ENODEV; it isn't possible to access the Linux console from inside a VE.

This is handled reasonably well by upstart and most of the rest of the system; when the init scripts are run the environment is such that STDIN, OUT and ERR are connected to /dev/null.

usplash is also, of course, not installed -- and even if it were it could not run.

The LSB logging functions interpret this as a reason to write directly to /dev/console; a reasonable choice in another environment but a problem here.

The issue is that the attempt will fail, returning an error code to the calling script. For scripts such as /etc/init.d/networking that run 'set -e' this, in turn, causes the entire script to abort.

I have attached a patch that simply ignores the failure when the console write attempt fails. While this will drop any messages on the floor I can't see a better way, short of creating a new log in /var/log (which may not be mounted yet) to record them.

I hope this patch is acceptable; it would be great to have this fixed shortly so that running Ubuntu in a VE is practical out of the box.

Regards,
        Daniel

Related branches

Revision history for this message
Daniel Pittman (daniel-rimspace) wrote :

This trivial patch ensures that failure to write logs direct to the console simply discards the failed message.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Fix uploaded

Changed in lsb:
status: Unconfirmed → Fix Released
Revision history for this message
Tom Wood (woodts) wrote :

This also occurs in 6.06 LTS.

Revision history for this message
Max Lindner (lokimuh) wrote :

This also occurs in 6.10

a fix would be greatly appreciated since nearly all services fail to start.

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.