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:
Blocks:
 
Reported: 2020-10-03 19:32 UTC by guyyur
Modified: 2022-02-19 17:39 UTC (History)
5 users (show)

See Also:


Attachments

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
https://lists.freebsd.org/pipermail/svn-src-head/2019-July/126776.html
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.

https://reviews.freebsd.org/D26654
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.
Comment 2 yvesguerin 2022-02-19 17:39:59 UTC
login(1) must honor the variable from /etc/login.conf: welcome=FOLDER_TO/motd

/etc/rc.d/motd needs to update motd with kernel info if update_motd="YES" so /etc/rc.d/motd needs to read the /etc/login.conf and find the motd file and update it.  If the filesystem where the motd file is read-only, display a message to inform the user/sysadmin.