Date: Tue, 16 Aug 2022 15:25:09 -0400 From: Dan Mahoney <freebsd@gushi.org> To: Kyle Evans <kevans@freebsd.org> Cc: questions@freebsd.org Subject: Re: Dual Consoles: Is there any way to have the output of startup scripts to go to both? Message-ID: <4B5D616C-4BE8-445E-9D17-E1BE6A25F748@gushi.org> In-Reply-To: <CACNAnaEv7tEsffixjL4yGwWJiCCEok3q=q2hK5zCNvZtSvF1FQ@mail.gmail.com> References: <72875947-CC8F-4CA9-84CD-441B86068B26@gushi.org> <CACNAnaEv7tEsffixjL4yGwWJiCCEok3q=q2hK5zCNvZtSvF1FQ@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] > On Aug 16, 2022, at 15:01, Kyle Evans <kevans@freebsd.org> wrote: > > On Tue, Aug 16, 2022 at 11:34 AM Dan Mahoney <freebsd@gushi.org <mailto:freebsd@gushi.org>> wrote: >> >> Hey there all, >> >> At the day job we have dell idrac machines that also do serial consoles (this is super convenient because you can get a serial console by ssh'ing to the idrac), instead of firing up a browser and a VPN (and, earlier, Java...eww). >> >> So naturally, in /boot/loader.conf we set console=comconsole,vidconsole. >> >> We get dmesg output out both consoles. We ultimately wind up with a login prompt on both consoles, but the output of boot scripts only go to one, and if the system craps the bed and drops to single-user mode, one console just "hangs" and the other one gives you useful output. >> >> It feels pretty trivial to have /etc/rc detect this unique condition, and perhaps put *some* output out to the inactive console, even if it's not capable of letting you do something interactive like an fsck from both. Just something that hints "hey, go check the other line, there's things happening over there". >> >> How hard would this be? >> > > I have some WIP that will scattershot console output to all configured > consoles, but right now there's not really a way to configure userland > output to go to non-primary consoles. Dmesg at least seems to already do this. It looks like the thing that handles sending output to the console is actually "init" per the line at the top of /etc/rc. Init sends to /dev/console, I'm guessing, and /dev/console can be only one device. Making rc bit detect and bit-bang unused consoles feels like asking for problems. That said, sysctl -a | grep console has these things: kern.always_console_output: 0 kern.log_console_add_linefeed: 0 kern.log_console_output: 1 kern.console: ttyv0,/uart,ttyv0,gdb, debug.witness.output_channel: console Can someone tell me what manpage would tell me more about the kern.console variable? -Dan [-- Attachment #2 --] <html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 16, 2022, at 15:01, Kyle Evans <<a href="mailto:kevans@freebsd.org" class="">kevans@freebsd.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On Tue, Aug 16, 2022 at 11:34 AM Dan Mahoney <</span><a href="mailto:freebsd@gushi.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">freebsd@gushi.org</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">> wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">Hey there all,<br class=""><br class="">At the day job we have dell idrac machines that also do serial consoles (this is super convenient because you can get a serial console by ssh'ing to the idrac), instead of firing up a browser and a VPN (and, earlier, Java...eww).<br class=""><br class="">So naturally, in /boot/loader.conf we set console=comconsole,vidconsole.<br class=""><br class="">We get dmesg output out both consoles. We ultimately wind up with a login prompt on both consoles, but the output of boot scripts only go to one, and if the system craps the bed and drops to single-user mode, one console just "hangs" and the other one gives you useful output.<br class=""><br class="">It feels pretty trivial to have /etc/rc detect this unique condition, and perhaps put *some* output out to the inactive console, even if it's not capable of letting you do something interactive like an fsck from both. Just something that hints "hey, go check the other line, there's things happening over there".<br class=""><br class="">How hard would this be?<br class=""><br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I have some WIP that will scattershot console output to all configured</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">consoles, but right now there's not really a way to configure userland</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">output to go to non-primary consoles.</span></div></blockquote></div><br class=""><div class="">Dmesg at least seems to already do this.</div><div class=""><br class=""></div><div class="">It looks like the thing that handles sending output to the console is actually "init" per the line at the top of /etc/rc. Init sends to /dev/console, I'm guessing, and /dev/console can be only one device.</div><div class=""><br class=""></div><div class="">Making rc bit detect and bit-bang unused consoles feels like asking for problems.</div><div class=""><br class=""></div><div class="">That said, sysctl -a | grep console has these things:</div><div class=""><br class=""></div><div class=""><div class="">kern.always_console_output: 0</div><div class="">kern.log_console_add_linefeed: 0</div><div class="">kern.log_console_output: 1</div><div class="">kern.console: ttyv0,/uart,ttyv0,gdb,</div><div class="">debug.witness.output_channel: console</div></div><div class=""><br class=""></div><div class="">Can someone tell me what manpage would tell me more about the kern.console variable?</div><div class=""><br class=""></div><div class="">-Dan</div></body></html>help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B5D616C-4BE8-445E-9D17-E1BE6A25F748>
