From owner-freebsd-arch@FreeBSD.ORG Wed Sep 10 17:25:59 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65B72FBB; Wed, 10 Sep 2014 17:25:59 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 198E01E8; Wed, 10 Sep 2014 17:25:59 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XRleW-000AZc-9G; Wed, 10 Sep 2014 21:25:56 +0400 Date: Wed, 10 Sep 2014 21:25:56 +0400 From: Slawa Olhovchenkov To: Warner Losh Subject: Re: /etc/motd summary Message-ID: <20140910172556.GA40066@zxy.spb.ru> References: <1412347.AsDd5CXCVa@ralph.baldwin.cx> <91F578E3-F1E3-47C4-9DE8-DB796F52A382@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <91F578E3-F1E3-47C4-9DE8-DB796F52A382@bsdimp.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: freebsd-arch X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2014 17:25:59 -0000 On Wed, Sep 10, 2014 at 11:10:07AM -0600, Warner Losh wrote: > > On Sep 10, 2014, at 8:06 AM, John Baldwin wrote: > > > On Monday, September 08, 2014 08:24:00 PM Warren Block wrote: > >> On Mon, 8 Sep 2014, Adrian Chadd wrote: > >>> On 8 September 2014 17:46, Brooks Davis wrote: > >>>> On Mon, Sep 08, 2014 at 05:25:31PM -0700, Adrian Chadd wrote: > >>>>> for maximum bikeshed: what about adding a 'motd' command that, I > >>>>> dunno, re-displays the motd? :P > >>>> > >>>> How would someone who didn't know about /etc/motd ever find that? > >>> > >>> Putting "Type 'motd' to see this information again" in the motd. > >> > >> Or leave it the way it is, /etc/motd is just a file that is displayed, > >> but instead of dumping it to stdout, interpret some kind of markup in > >> it. > >> > >> That's relatively high overhead considering the layout will still be > >> limited to 80x24. We'd probably be better off leaving it as is and > >> moving most of the information to a man page, say support(1), which is > >> mentioned by /etc/motd. > > > > Yes. You can use formatting if you have a 'man welcome'. That might be the > > best way to provide a local, formatted copy of the proposed "welcome" page > > from earlier. You could even create a very simple 'welcome' wrapper script > > that runs 'man welcome' so that in the motd you just have to say "run the > > welcome command". No need for having to worry about having to figure out how > > to separate arguments from the command that way (which is the the problem we > > have now that requires double spaces since all the examples are commands that > > take arguments like 'man man'). For a command with no arguments you don't > > have to do that I think. > > Stepping back from this problem a bit and refocusing on the original ask (I want to put ANSI escape sequences to punch things up a bit): > > We have the terminal set (usually) by the time we cat /etc/motd. login.conf controls this with the welcome= parameter. We have two choices here. > > One, allow the welcome string to start with | and have it be the command to run. This could be "man welcome" or something else canned. Flexible, but maybe not the best. > > Another vector to this approach would be to allow /etc/motd to start with #!/usr/bin/man (or some other magic) and have it run through a fixed program like man (and only man) instead of just being cat'd out. This would allow proper rendering on all devices in a way that's backwards compatible as well, but maybe with less security concerns. I like this better because it puts the message of the day file in control of today's message... > > These tools would allow for a fancier rendition of whatever text is decided here as well as not violating POLA. May be simple reduce /etc/motd to one line (FreeBSD ... 2014) and rest of information by some programs, similar to fortune or man (from login script).