Re: How to disable console on serial when needed ?



Raymond <skyflame@xxxxxxxx> wrote:
Hi
I want to disable console on serial when I need to use the serial port
to control some serial device.

"console on a serial line" is simply a "getty" (or similar, often agetty
or mgetty) program running connected to the serial line. These are usually
controlled by the "init" program, by entries in /etc/inittab

However this does not have to be the case. First comment out any lines in
/etc/inittab to prevent init from starting any "getty" process attached to
the serial line. Then arrange for the getty process to be started instead
by one of the initialise scripts. When you want to use the serial line,
then simple kill the getty process, use the line then restart the getty
when you have finished

But I still need to use it for log on when these serial device are not
in use. So I can't just remove the console on serial support from kernel at
compile time.

You are confusing things.

"Console on Serial" is not required for you to be able to login
on a serial line.

When the kernel starts, or needs to send diagnostic messages it does it to
a "Console", usually the first virtual terminal device (VT0). "Console on
Serial" makes the kernel send these messages out on a nominated serial
line.

If you do have serial console enabled on the line then you have got
problems. The kernel may generate output that may interfer with your
application.

And what I need is the ability to detach / attach console to serial port
after bootup.

see above
.



Relevant Pages