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

From: Miquel van Smoorenburg (miquels@cistron.nl)
Date: Sat Feb 26 2000 - 13:17:44 EST


In article <cistron.20000226114501.D9382@alice.realminfo.com>,
Mike Panetta <mpanetta@realminfo.com> wrote:
>Should /dev/console always be available even if there is no
>video card or keyboard on a machine?

You could simply link it to /dev/null

>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.

Those are userlevel programs that cannot cope with not having a
console. That's not a kernel issue I think.

>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. Since then I have upgraded all the libraries
>to be compilant with the rquirements in Documentation/Changes and the
>corruption has gone away.

Ah, but did you upgrade the e2fstool as well? Those might have
caused the corruption in the first case.

Often a program doesn't check if stdin, stdout and stderr are
really opened at the start of the program, it is simply assumed
they are open and they are fd# 0, 1 and 2.

Now if that program is fsck, and it opens /dev/hda1 to check it,
and it happens to get filedescriptor #1 back from open(), image
what happens if the program does a printf("checking /dev/hda1 .. \n");

At least mount(1) had a bug like this (the garbage ended up in
/etc/mtab), other tools might as well.

So it's probably a good idea to link /dev/console to /dev/null.

Mike.

-- 
"dhbgr zr ba guvf bar - biretnna bc Rkpunatr vf rra jvwf orfyhvg" -- ZnepbU.
  (punatrq gb ebg13 nsgre frireny frevbhfyl fbhaqvat guerngf).

- 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