/etc/lsb-base-logging.sh causes some initscripts to abort if console is unavailable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lsb (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
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.
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
This trivial patch ensures that failure to write logs direct to the console simply discards the failed message.