Bug 275273 - /etc/motd
Summary: /etc/motd
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 14.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
: 275274 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-11-23 02:02 UTC by dan
Modified: 2023-11-24 21:00 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dan 2023-11-23 02:02:02 UTC
/etc/motd is overwritten now anytime a system administrator edits the file.

/etc/motd is currently a sym link to /var/run/motd. Currently way things work,
/etc/motd.template is used along with a freebsd header everytime 
service motd restart is run or a reboot occurs, effectively killing anything added to /etc/motd.

A fix would be "rm /etc/motd; ln -s /etc/motd.template /etc/motd"

There is no reason for /etc/motd to do a useless symlink to /var/run/motd just for changes to be overwritten, when it would be way better if the link was made to /etc/motd.template instead so the system administrators changes are not lost between reboots etc.
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2023-11-23 05:39:47 UTC
*** Bug 275274 has been marked as a duplicate of this bug. ***
Comment 2 Li-Wen Hsu freebsd_committer freebsd_triage 2023-11-23 05:45:39 UTC
How about directly editing /etc/motd.template, to keep the system information updated, or setting update_motd="NO" in /etc/rc.conf and to prevent it getting updated?
Comment 3 dan 2023-11-23 19:16:38 UTC
Because if you do that and reboot, your /var/run/motd gets wiped out completely.
So either symlink needs to be removed or point to motd.template.
Comment 4 matthias+freebsd+bugzilla 2023-11-24 13:19:59 UTC
on diskless / netbooted machines with RO /etc it will work now.
your proposed changes will not.
Comment 5 dan 2023-11-24 21:00:40 UTC
I'm talking about production system running FreeBSD 14-RELEASE.
I just hate to see a sys admin spend hours setting up a system, put all the notes in /etc/motd to have it all wiped out on him/her.

People don't think its now /etc/motd.template, they add stuff on linux box to /etc/motd, then whatever OS, then when they get to FreeBSD server do same thing and its all wiped out....not sure why this changed, it was fine for years.