onie
onie copied to clipboard
Fix onie discover stopped while console XOFF is triggered
This patch print logs to files, which was printed to /dev/console directly - tee_log_file to /var/log/onie-tee.log - _log_console_msg to /var/log/onie-console.log - /etc/rcS.d/S30console-logger.sh will tail these logs to /dev/console
Cause: While XOFF is trigger with console port somehow, onie discover will stop searching installer after a while.
Reproduce: 1. In console terminal, type CTRL+S to send XOFF 2. telnet/ssh to DUT, and tail -f /var/log/onie.log 3. The discover loop will stop searching after a while, since linux kernel console buffer is full.
Interesting. Good find.
Thinking about this a bit more.... Are we sure this is really a problem worth solving?
Why would someone type ctrl-S on the serial console in the first place? This might be a problem for a developer who is working on ONIE, even that would rare. I don't see how this would ever impact an end user.
My big concern with the new implementation is that we are creating two new log files that will grow without bound. We already have /var/log/onie.log that captures all the output Imagine this scenario:
- a new switch is plugged in a data center on a Friday afternoon
- the operator has problems configuring DHCP or whatever and goes home for the weekend
- the switch keeps running, going through the image discovery waterfall
- the two new files keep growing, along with syslog file /var/log/onie.log
- all of this is in a ramdisk
- by Monday morning when the operator comes back the system has run out of memory
- the operator fixes the DHCP problem, but switch will not install an image because it is out of memory
That sounds bad to me.
I think this is a "won't fix". What we should do, however, is make a note of the problem. Instead of a pull request with a fix, I will create an "issue" to track this problem.
I created #387 to track this issue. I do not think we will fix this problem, however.
The XOFF
may not be sent by human. With console port, the XOFF
is just some signals. That means, if someone plug ethernet port into console port, which is also RJ45, the console may receive the XOFF
.