Re: /dev/console should it always be available?

From: Guest section DW (dwguest@win.tue.nl)
Date: Sat Feb 26 2000 - 15:08:33 EST


On Sat, Feb 26, 2000 at 11:45:01AM -0500, Mike Panetta wrote:

> Should /dev/console always be available even if there is no
> video card or keyboard on a machine? I keep getting these
> messages in the logs about init not being able to open(/dev/console)
> when I remove the video card from an embedded box I am working on.
> when I do this strange things start to happen like it cannot properly
> umount /dev/hda5 (not root partition) on shutdown, and mingetty starts
> to respawn to fast. This is related to a previous message I sent to the
> list about a week ago reguarding the ext2 corruption messages without
> a video card in the machine.

You need to watch out for the problem that programs print messages to
stdout or stderr without checking first whether fd 0, 1, 2 actually were
open when the program was started. If some init variant opens /dev/console,
and dups the fd twice to get 0,1,2 all will be fine with a console, but
without a console programs may be called without good stdout and stderr.
If now mount or e2fsck or some other program opens a disk device, and
later prints something it may be printed to your disk instead of screen.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:15 EST