Page MenuHomeFreeBSD

motd: stop prepending "uname -v" output dynamically
Needs ReviewPublic

Authored by michaelo on Feb 1 2024, 6:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 9, 8:11 AM
Unknown Object (File)
Wed, May 8, 11:27 PM
Unknown Object (File)
Sat, Apr 27, 9:32 AM
Unknown Object (File)
Sat, Apr 27, 9:32 AM
Unknown Object (File)
Sat, Apr 27, 8:12 AM
Unknown Object (File)
Mon, Apr 22, 3:53 AM
Unknown Object (File)
Mar 30 2024, 8:45 AM
Unknown Object (File)
Mar 7 2024, 7:04 PM
Subscribers

Details

Reviewers
jrm
otis
emaste
Summary

Make the motd generation completely static with this change.
Prepending the output of uname(1) may lead to confusing and/or incorrect
output if you are in a jail which has a different version of world
compared to the jailhost kernel/world. For those who need a fully
dynamic motd can still use sysutils/dynamic_motd port.

PR: 276763
Approved by: jrm (mentor), otis (mentor), emaste
MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55748
Build 52637: arc lint + arc unit

Event Timeline

This one comes from: https://github.com/BastilleBSD/bastille/issues/393

Feel free to add someone you think appropriate to review.

I don't have strong options either way. On the one hand, I can appreciate how this would confuse some users when they log in to a jail. On the other hand, I expect some users would miss seeing this information (by default) when they log in. While it may also be confusing, it's reporting accurate information that many would expect, i.e., version information about the running kernel.

Brainstorming ideas, what about appending something like this to /var/run/motd?

echo "$(hostname) $(uname -smi) running kernel/userland: $(uname -r)/$(freebsd-version -u)"

In a 14 jail running on a 15-CURRENT host, the output looks like this.

myhostname FreeBSD amd64 GENERIC-NODEBUG running kernel/userland: 15.0-CURRENT/14.0-RC4
In D43703#1000910, @jrm wrote:

I don't have strong options either way. On the one hand, I can appreciate how this would confuse some users when they log in to a jail. On the other hand, I expect some users would miss seeing this information (by default) when they log in. While it may also be confusing, it's reporting accurate information that many would expect, i.e., version information about the running kernel.

Brainstorming ideas, what about appending something like this to /var/run/motd?

echo "$(hostname) $(uname -smi) running kernel/userland: $(uname -r)/$(freebsd-version -u)"

In a 14 jail running on a 15-CURRENT host, the output looks like this.

myhostname FreeBSD amd64 GENERIC-NODEBUG running kernel/userland: 15.0-CURRENT/14.0-RC4

Yeah, I am open as well. What I would like to see is consistency: either no information or always correct information. What I don't know whether we should try to add something which is done by sysutils/dynamic_motd already. I also wonder whether both freebsd-version -r/freebsd-version -u can also confuse users. While we could introduce a parameter with none, kernel, userland, both, but then we are back with sysutils/dynamic_motd.