Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 11:10:07 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-arch <freebsd-arch@freebsd.org>
Subject:   Re: /etc/motd summary
Message-ID:  <91F578E3-F1E3-47C4-9DE8-DB796F52A382@bsdimp.com>
In-Reply-To: <1412347.AsDd5CXCVa@ralph.baldwin.cx>
References:  <alpine.BSF.2.11.1409081223060.15689@wonkity.com> <CAJ-VmonjQiC9xbanh-w19n2QcLLn8w1gwF7jvv470xQd0DyV9g@mail.gmail.com> <alpine.BSF.2.11.1409082015130.41256@wonkity.com> <1412347.AsDd5CXCVa@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <jhb@freebsd.org> 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 <brooks@freebsd.org> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?91F578E3-F1E3-47C4-9DE8-DB796F52A382>