From nobody Tue Aug 16 19:25:09 2022 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M6h1l0whpz4ZDwp for ; Tue, 16 Aug 2022 19:25:15 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from prime.gushi.org (prime.gushi.org [IPv6:2620:137:6000:10::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "prime.gushi.org", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M6h1k4Mp9z3R9l; Tue, 16 Aug 2022 19:25:14 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from smtpclient.apple (vpn-us.f.root-servers.org [149.20.8.9]) (authenticated bits=0) by prime.gushi.org (8.16.1/8.16.1) with ESMTPSA id 27GJP9A2088452 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Aug 2022 12:25:10 -0700 (PDT) (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 27GJP9A2088452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1660677911; bh=MhJbBJsei5F38fjDlOcMQRQOK/9jeNOcC6XuxC5DysI=; h=From:Subject:Date:In-Reply-To:Cc:To:References; z=From:=20Dan=20Mahoney=20|Subject:=20Re:=20Dual =20Consoles:=20Is=20there=20any=20way=20to=20have=20the=20output=2 0of=20startup=0D=0A=20scripts=20to=20go=20to=20both?|Date:=20Tue,= 2016=20Aug=202022=2015:25:09=20-0400|In-Reply-To:=20|Cc:=20que stions@freebsd.org|To:=20Kyle=20Evans=20|Refer ences:=20<72875947-CC8F-4CA9-84CD-441B86068B26@gushi.org>=0D=0A=20 ; b=tCSkDeBXt9pqlPc3utvC8uxg93JRUU0rCJShoktSzErav/6BGX13kPwwYytkJT320 9sJOmifuLc1tuGPSBw+jZNwvpBaxeMguM8tf7fZI1tJ4d7c6k8ikEk8cT+XWAhSt3m cscoqkuEedeC2lv4+w0S9vO7FgXaoUVaHqfr9Gc9FHVJy6PMBN5W/B5KCj+J4l36ZC qdT8SZkdkHLFgysGA/hPKBP6dKmi+DkW6XCmNujNHIcrXJQIuB40By6adxFAOp9Hc2 18ylbpJG8rw2bPSF3m2s58oefaTRHNQbPT8FW18rnmODgOJ81sgkHo9LiTY1HGtz3c MZzfWi4J3AW5w== X-Authentication-Warning: prime.gushi.org: Host vpn-us.f.root-servers.org [149.20.8.9] claimed to be smtpclient.apple From: Dan Mahoney Message-Id: <4B5D616C-4BE8-445E-9D17-E1BE6A25F748@gushi.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_611ED23B-0875-44AC-8BA6-BD032F8438D5" List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: Dual Consoles: Is there any way to have the output of startup scripts to go to both? Date: Tue, 16 Aug 2022 15:25:09 -0400 In-Reply-To: Cc: questions@freebsd.org To: Kyle Evans References: <72875947-CC8F-4CA9-84CD-441B86068B26@gushi.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4M6h1k4Mp9z3R9l X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gushi.org header.s=prime2014 header.b=tCSkDeBX; dmarc=pass (policy=none) header.from=gushi.org; spf=pass (mx1.freebsd.org: domain of freebsd@gushi.org designates 2620:137:6000:10::142 as permitted sender) smtp.mailfrom=freebsd@gushi.org X-Spamd-Result: default: False [-5.20 / 15.00]; DWL_DNSWL_MED(-2.00)[gushi.org:dkim]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gushi.org,none]; R_SPF_ALLOW(-0.20)[+mx]; RCVD_IN_DNSWL_MED(-0.20)[2620:137:6000:10::142:from]; R_DKIM_ALLOW(-0.20)[gushi.org:s=prime2014]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:393507, ipnet:2620:137:6000::/44, country:US]; RCPT_COUNT_TWO(0.00)[2]; HAS_XAW(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[gushi.org:+]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --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 wrote: >=20 > On Tue, Aug 16, 2022 at 11:34 AM Dan Mahoney > 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

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> 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=3Dcomconsole,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
= --Apple-Mail=_611ED23B-0875-44AC-8BA6-BD032F8438D5--