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>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_611ED23B-0875-44AC-8BA6-BD032F8438D5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 16, 2022, at 15:01, Kyle Evans <kevans@freebsd.org> wrote: >=20 > On Tue, Aug 16, 2022 at 11:34 AM Dan Mahoney <freebsd@gushi.org = <mailto:freebsd@gushi.org>> wrote: >>=20 >> Hey there all, >>=20 >> 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). >>=20 >> So naturally, in /boot/loader.conf we set = console=3Dcomconsole,vidconsole. >>=20 >> 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. >>=20 >> 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". >>=20 >> How hard would this be? >>=20 >=20 > 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= --Apple-Mail=_611ED23B-0875-44AC-8BA6-BD032F8438D5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On Aug 16, 2022, at 15:01, Kyle Evans <<a = href=3D"mailto:kevans@freebsd.org" class=3D"">kevans@freebsd.org</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><meta = charset=3D"UTF-8" class=3D""><span style=3D"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=3D"">On Tue, Aug 16, 2022 at 11:34 AM Dan Mahoney <</span><a = href=3D"mailto:freebsd@gushi.org" style=3D"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=3D"">freebsd@gushi.org</a><span = style=3D"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=3D"">> wrote:</span><br = style=3D"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=3D""><blockquote type=3D"cite" style=3D"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=3D""><br = class=3D"">Hey there all,<br class=3D""><br class=3D"">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=3D""><br class=3D"">So naturally, in = /boot/loader.conf we set console=3Dcomconsole,vidconsole.<br = class=3D""><br class=3D"">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=3D""><br class=3D"">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=3D""><br class=3D"">How hard = would this be?<br class=3D""><br class=3D""></blockquote><br = style=3D"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=3D""><span = style=3D"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=3D"">I have some WIP that will = scattershot console output to all configured</span><br = style=3D"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=3D""><span = style=3D"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=3D"">consoles, but right now there's = not really a way to configure userland</span><br style=3D"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=3D""><span style=3D"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=3D"">output to go to non-primary = consoles.</span></div></blockquote></div><br class=3D""><div = class=3D"">Dmesg at least seems to already do this.</div><div = class=3D""><br class=3D""></div><div class=3D"">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=3D""><br class=3D""></div><div class=3D"">Making rc bit detect and = bit-bang unused consoles feels like asking for problems.</div><div = class=3D""><br class=3D""></div><div class=3D"">That said, sysctl -a | = grep console has these things:</div><div class=3D""><br = class=3D""></div><div class=3D""><div = class=3D"">kern.always_console_output: 0</div><div = class=3D"">kern.log_console_add_linefeed: 0</div><div = class=3D"">kern.log_console_output: 1</div><div class=3D"">kern.console: = ttyv0,/uart,ttyv0,gdb,</div><div class=3D"">debug.witness.output_channel: = console</div></div><div class=3D""><br class=3D""></div><div = class=3D"">Can someone tell me what manpage would tell me more about the = kern.console variable?</div><div class=3D""><br class=3D""></div><div = class=3D"">-Dan</div></body></html>= --Apple-Mail=_611ED23B-0875-44AC-8BA6-BD032F8438D5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B5D616C-4BE8-445E-9D17-E1BE6A25F748>