Re: How to disable console on serial when needed ?



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

Is there any possible way to achieve this?

I don't know of a way to do so, but I don't know how your device works, so I
can only guess. Maybe it is possible for you to create two kernel images,
one with console on serial line and one without. If you don't use your
serial device and want to log in, you then would need to reboot and select
the other kernel image (lilo supports a serial console as well).

On the other hand, you could compile the kernel with serial console
included, but later remove in the APPEND line, as in console=/dev/null or
console=0,9600n8 respectively. The getty process started to actually use
this console after booting can be killed or started on demand (that means
only to start it from the init process if the kernel image is the one with
serial console or if the append line includes the correct key word).

I think it is possible to redirect the kernel console while running and I
remember having seen a C source which does the kernel call, but I couldn't
find it. That way some people were able to print out kernel messages to
running telnet connections (like /dev/pts/0) instead of a serial port.

On the other hand - if your memory requirements are not too tight - you
could run a syslogd and a klogd who "catch" these messages and call them out
onto the net (or anywhere else you want these messages, probably /dev/null).
BusyBox provides these, but I'm not sure whether it will work this way.

Hope this helps,
Regards,
Sebastian


.



Relevant Pages

  • Re: 6.0 random freezes
    ... the probe/attach sequence relies on the kernel being in a reasonably sane state (and I'm not sure if it will detect the keyboard as a console device except at boot time). ... I'm in process of getting a serial console, so if there's no response as well, I will enable the sanity checks. ...
    (freebsd-stable)
  • Re: Serial console trouble: loader and login works, but no kernel messages
    ... Perhaps the vidconsole is favored when a keyboard is ... during kernel load and then get a login once the OS was up, ... I had to add a kernel argument to my Grub config ... On the serial console, I go from the screen with the FreeBSD logo, ...
    (freebsd-questions)
  • Re: [Bugme-new] [Bug 11886] New: without serial console system doesnt poweroff
    ... Earliest failing kernel version:2.6.27.2 ... If I does't add serial console to kernel command line ... Disabling non-boot CPUs ... ... commit a6629105dd03d370fcb31e97bddf223fa4bb651e upstream. ...
    (Linux-Kernel)
  • Re: changing debuglevel of kernel messaging going to console
    ... Moreover, several kernel messages ... > sending bogus ARP replies. ... > FreeBSD box with serial console may lead to a DoS like conditions. ... while working on a Linux firewall which was printing all NetFilter's log ...
    (freebsd-current)
  • Re: ACPI Panic on Current, AMD64
    ... capture the full dmesg, please let me know. ... way it still to get serial console working. ... to try if you can compile your own kernel (you can do in on the 7.x ... partition, just compile kernel for 8-CURRENT, set it to boot with ...
    (freebsd-current)