Re: [PATCH] Console: fall back to /dev/null when no console is availlable

From: Russell King
Date: Wed Oct 06 2004 - 16:53:34 EST


On Wed, Oct 06, 2004 at 09:29:44PM +0100, Alan Cox wrote:
> On Mer, 2004-10-06 at 21:54, Greg KH wrote:
> > Ok, then anyone with some serious bash-foo care to send me a patch for
> > the existing /sbin/hotplug file that causes it to handle this properly?
>
> Something like
>
> #!/bin/sh
> (
> Everything you had before
> ) <>/dev/console 2>&1

What about:

#!/bin/sh
exec </dev/null >/dev/console 2>&1 || exec </dev/null >/dev/null 2>&1
... original stuff ...

?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/