From nobody Tue Aug 16 19:37:05 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 4M6hGk5qSzz4ZGRS for ; Tue, 16 Aug 2022 19:36:30 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M6hGk5GY6z3Sph; Tue, 16 Aug 2022 19:36:30 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660678590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KYISUZ72fXhOJ0fkLx5XBxLmGLaLvzb9l/UODFrfmdI=; b=dsAk/5kVr5us/1xf6VCg6bkiMsJEbQ8DReRqX7gyCO8yUpquqg4/4ps6rRDQnI6vQAVLgc IuOZX9EuLTYt9LsgnlUP6+hHs6TioVpPNcRdmD1jsvjiB2jG6L3YomDOUW073J16z8Iis9 k5Ny5kPhj5B6YDEMuyXchpuiCfKOntHavmM9/CFAcS+vH6krS4w5VMLP85kBEQX7uwf/YE BpSESQZBR7jFY+2nU/2UjOC4+Cws5dxvWrsI4SORXNZeHzNq7LU9lfptsCXEbTI1L9eQYi 9On8878UpJT77TpBuRcmJyijSp+R//gYC5X4D2xhhJK9sldPTbkzeBglJuotxA== Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4M6hGk4C4zz13Fg; Tue, 16 Aug 2022 19:36:30 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f171.google.com with SMTP id w28so8926477qtc.7; Tue, 16 Aug 2022 12:36:30 -0700 (PDT) X-Gm-Message-State: ACgBeo0qEew2Bm60Q3KhIz+arGN8hqZcHbsZuTrTurrsm4+O9NLGx3sg cwAspsb3hmHiVMB8djiCwXMcH2wGYzP/uzjkXno= X-Google-Smtp-Source: AA6agR6isbbq++32hA7q02DGb590mbkk026TnTv5862bSduxYLWTNIGTIr5vK5b2H+Gorx5VwTTuw/B36uvodlzZIUw= X-Received: by 2002:ac8:7d01:0:b0:343:5914:6419 with SMTP id g1-20020ac87d01000000b0034359146419mr19387004qtb.538.1660678590255; Tue, 16 Aug 2022 12:36:30 -0700 (PDT) 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 References: <72875947-CC8F-4CA9-84CD-441B86068B26@gushi.org> <4B5D616C-4BE8-445E-9D17-E1BE6A25F748@gushi.org> In-Reply-To: <4B5D616C-4BE8-445E-9D17-E1BE6A25F748@gushi.org> From: Kyle Evans Date: Tue, 16 Aug 2022 12:37:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Dual Consoles: Is there any way to have the output of startup scripts to go to both? To: Dan Mahoney Cc: Kyle Evans , questions@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660678590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KYISUZ72fXhOJ0fkLx5XBxLmGLaLvzb9l/UODFrfmdI=; b=mg6KVgSorZF78Izdtm+G/V2E+VRzPZ33mjsftmI4PNNeG6c/F67owLCyAwrApO6XGY8ARo Tzrx1oGCMKNy4xp8iRn9Mt/JFMwy6aKmTglZ40QoOvUre8a2bbCVri45xYbwvvJma9wA8A XKNWf3RtbisGAWGSG+RK87Dw84wnRIJ3EDrRgTnCBXh18LQ/Kp8DCg9IUHOaBt7cpiWNC6 KUowbM5niRQWguDU+uTWw1+BbZcvlA6bfDrSntTWDEnDIjRlFuWp+irZR5ZdY5mX/Ut/X9 Aati/71GU5NIDkLrb2oMcI5rgmUp6PaAgI/hvgjH8dNVIkkNrOXhwcwYoJjc0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660678590; a=rsa-sha256; cv=none; b=JX32N3NIZaIN0jBZZk6xa1Ie572H9KKkrQOau4ORxqg78t9KdkfkL7L40zhXSItOgKRh9t OXYAWB820aCJXRTTtlTlD5CDm/OQBr5Nitjln0dXjXPuDZh6CQC7vxwW8TwBONidC3kAEm xPwRf4Q7jPfl3/9m0zacE3F7OdaaXITh9Reu8BKQoyBob3h9ZLRUnCTI01wceaWyA9oWRa aCsghK+PJGNx19IhfwmYtxq2FguykDCvhlJlSU43Y2pGbj4+OAy2rcuf1QVYAr7pARX/6e Fer9HlnYoH0Bler4UA6sXDQ9/AsesvZNrdkfAn6IEqL1z9yFHoRADdqjtjM6XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Tue, Aug 16, 2022 at 12:25 PM Dan Mahoney wrote: > > > > On Aug 16, 2022, at 15:01, Kyle Evans wrote: > > On Tue, Aug 16, 2022 at 11:34 AM Dan Mahoney 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 logi= n prompt on both consoles, but the output of boot scripts only go to one, a= nd if the system craps the bed and drops to single-user mode, one console j= ust "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 ca= pable of letting you do something interactive like an fsck from both. Just= something that hints "hey, go check the other line, there's things happeni= ng 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 act= ually "init" per the line at the top of /etc/rc. Init sends to /dev/consol= e, I'm guessing, and /dev/console can be only one device. > > Making rc bit detect and bit-bang unused consoles feels like asking for p= roblems. > Right, I don't like that idea, either. My WIP throws a new tty behind /dev/console that replicates messages to all configured consoles, so that all of these userland things that write to /dev/console will just DTRT. Thanks, Kyle Evans