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

Russell King
2004-10-06T21:49:51Z

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