Potential BUG: update_motd="YES" is prepending same text on ever reboot

Rahul Bharadwaj rahulbharadwajpromos at gmail.com
Wed Dec 23 07:18:09 UTC 2020


Ok after a bit more debugging I found the issue.

The kernel has a different uname output (i.e. "uname -v" does not return
"FreeBSD" in its output). So when /etc/motd is run , the following awk
command runs (inside of /etc/rc.d/motd):

awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else
{print}}' < /etc/motd >> ${T}

In this, the check is done only for "FreeBSD" and thus for this
non-standard BSD kernel, we were seeing the same line being appended to the
file.

On Wed, Dec 16, 2020 at 12:04 PM Rahul Bharadwaj <
rahulbharadwajpromos at gmail.com> wrote:

> Hi,
>
> Can anyone please see if they face the same issue with their FreeBSD
> machines. It is really annoying to see the same line printed several times
> on every restart.
>
> Thanks and Regards.
>
> On Tue, Dec 8, 2020 at 8:17 PM Rahul Bharadwaj <
> rahulbharadwajpromos at gmail.com> wrote:
>
>> Hi,
>>
>> My FreeBSD details are:
>> FreeBSD 11.3
>>
>> I have the following option in my /etc/rc.conf:
>> *update_motd="YES"*
>>
>> Every time I reboot, the output from the "uname" command is prepended to
>> the previous reboot in the /etc/motd file. So on 3 restarts, it prints like
>> this:
>>
>> *$ ssh user at ip*
>>
>> *FreeBSD user 11.3 ...*
>> *FreeBSD user 11.3 ...*
>> *FreeBSD user 11.3 ...*
>>
>> *<my actual motd>*
>>
>>
>> Here's what I have tried already:
>> - Searched the mailing list for any mention of "motd" or "update_motd".
>> None match my issue.
>> - Searched the FreeBSD bugzilla for "motd", there are 2 bugs, none of
>> which match my issue.
>> - Read the man page for rc.conf and motd, they don't give any hints on
>> bugs.
>>
>> So I'm not sure if this is even a bug. Can someone please help out on
>> this.
>>
>> Thanks and Regards.
>>
>>


More information about the freebsd-questions mailing list