Bug 250081 - no motd displayed after reboot when update_motd="NO"
Summary: no motd displayed after reboot when update_motd="NO"
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL: https://reviews.freebsd.org/D26654
Keywords: patch
Depends on:
Reported: 2020-10-03 19:32 UTC by guyyur
Modified: 2021-04-05 17:50 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description guyyur 2020-10-03 19:32:01 UTC
r350184 changed login(1) to read /var/run/motd.

As been noted in
there is a need to support displaying an immutable motd with specific exact text at login.

To keep motd immutable and prevent it being prepended with uname output,
update_motd needs to be set to "NO" in rc.conf to not generate /var/run/motd.
An immutable motd file can then can be created in /var/run
but if it is a tmpfs, the file will not survive a reboot.

Phabricator review to change login(1) back to reading /etc/motd.
This allows using /etc/motd as a regular file when update_motd="NO".
update_motd="YES" causes /etc/motd to be created as a symbolic link to /var/run/motd so login(1) will still read it.
Comment 1 guyyur 2021-04-05 08:54:50 UTC
The problem also affects update_motd="NO" when not using tmpfs for /var/run.

cleanvar_enable="YES" by default and cleanvar scripts removes files under /var/run so if motd is created there manually it will be deleted after reboot.