From owner-freebsd-arch@FreeBSD.ORG Wed Sep 10 17:10:12 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09BB1AFB for ; Wed, 10 Sep 2014 17:10:12 +0000 (UTC) Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com [209.85.223.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C26181FB0 for ; Wed, 10 Sep 2014 17:10:11 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id x19so3879183ier.4 for ; Wed, 10 Sep 2014 10:10:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=oqTIFnBlOGnu0yGPILSi7SxU+slRuDsOA2Sh2TLzzPA=; b=NAw5E0NFRnJvWi0NQvXotJNnr1m84w7Ir/CPMv+75NpVI1H/IbxtVvZEmSc9PKpmKh P1VDo/eHMSboTGeM1rNs41+v8GUMZb77lYYukqQcrSyW/dJ6JoRyZPb9Rii3hGS24DGl FlcXg7MKHCTFUjRUWSsqjOOevtZmJCJTgkZ+SMqbloPv6SGmcuscwiS36DcbbAqkFB1w wAkDfK4ynBhMY/7dnwGpGgOMSQ7JIaC0DlALmdEaeMuHZ65R4jT4NLzo4YIWFiXhtmbf b+/FpRFNjxoKXFkB4Loq2+B846pHHFv1ba/NxoIJG6DYiy2HEuvGGUDyXkWRwD8frS4Q rKXQ== X-Gm-Message-State: ALoCoQnlBZ2eA/Wx+YQcPheSRzsLrGfCyoessCUKoxaA5eiWzLTGuI72VWGBcdyhKLZ9++MsXbKD X-Received: by 10.42.254.129 with SMTP id ne1mr46549410icb.29.1410369010868; Wed, 10 Sep 2014 10:10:10 -0700 (PDT) Received: from bsdimp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ci9sm2487626igb.17.2014.09.10.10.10.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Sep 2014 10:10:10 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_211892D1-BF4C-40BC-965B-9F406FAE39F7"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: /etc/motd summary From: Warner Losh In-Reply-To: <1412347.AsDd5CXCVa@ralph.baldwin.cx> Date: Wed, 10 Sep 2014 11:10:07 -0600 Message-Id: <91F578E3-F1E3-47C4-9DE8-DB796F52A382@bsdimp.com> References: <1412347.AsDd5CXCVa@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) 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:10:12 -0000 --Apple-Mail=_211892D1-BF4C-40BC-965B-9F406FAE39F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 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 >>>>=20 >>>> How would someone who didn't know about /etc/motd ever find that? >>>=20 >>> Putting "Type 'motd' to see this information again" in the motd. >>=20 >> 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. >>=20 >> 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. >=20 > Yes. You can use formatting if you have a 'man welcome'. That might = be the=20 > best way to provide a local, formatted copy of the proposed "welcome" = page=20 > from earlier. You could even create a very simple 'welcome' wrapper = script=20 > that runs 'man welcome' so that in the motd you just have to say "run = the=20 > welcome command". No need for having to worry about having to figure = out how=20 > to separate arguments from the command that way (which is the the = problem we=20 > have now that requires double spaces since all the examples are = commands that=20 > take arguments like 'man man'). For a command with no arguments you = don't=20 > 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=3D 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 =93man welcome=94 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=92d out. = This would allow proper rendering on all devices in a way that=92s = 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=92s message... These tools would allow for a fancier rendition of whatever text is = decided here as well as not violating POLA. Warner --Apple-Mail=_211892D1-BF4C-40BC-965B-9F406FAE39F7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUEIXvAAoJEGwc0Sh9sBEArs4P/iGVXTM4fbFiTcE53daMhFmN awc/Pe2L/1v6GcMlo5VZ7IvtPa92IPGjH2iK5L7xYbSfT3ABdyd1fyX120aXRsL3 iFkObt5vqYu9oVndXPdGJe4PeiM4iB0aau82NF3s9ApTxNpsQAd5JSfrAiYqdT2b Eb2gjNE6BkhB0ctrPHIAhH8QVuONDjC8ik1TMdqm4IW9I458L+1Pg4XBj9DnQrZ0 YmfEBdSX49VEcEh9EhC15IldEpPQ3WCrc6D2JjT2ENHbyg1bH+Ah6Glcl27ppNNQ TQhxfU+gDVid3gn2UGXTwFHekmGZW8WyeLsT6PCJnSXPzeSahqQwPEQE6sR0iYKk +i0lcA+FwQDbhI/GKkb4AfMt5rwMSY7bWz+iCoIManPCg4OEppkSeto6iMpTBn/7 V3CFwl5yAdtRXeCq5FuhDWOjOhXSrO2j6yPpnK4mzIFpU7q01hl3BwgsSflhpLbR cE02fu3dWTl2ehu7w7UxVA6FDkOG+eFsOPFMmgRrvcT6CCLcAFt2Zn0wfI1RWxcH 79ynHmn8U5aqAt44r5SqNlko3Yex4YSRffR5jlgOcD6C4cY38LtYgPmR4WzD28bq Xd4wwGY6jf+UdiLBuOXyE4plHMHIdZbUJytpN9roRroCH8DV7O8rpPWLZSFqXsv+ 34HaOd26uEYYet3WGbrk =h2My -----END PGP SIGNATURE----- --Apple-Mail=_211892D1-BF4C-40BC-965B-9F406FAE39F7--