Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 4226  / 3 Years ago, sun, june 13, 2021, 3:06:31

motd.tail is deprecated according to this bug report:



motd(5) says: "The contents of this file are regenerated upon every system
boot based on the contents of /etc/motd.tail." This is not true anymore, as
Ubuntu uses the update-motd framework. Any reference to motd.tail should be
replaced with a reference to the update-motd framework or update-motd(5).
The manpage for motd.tail should be removed.


I'm using it to identify my servers when I log in and make sure I'm on the right machine, so I don't need anything dynamic, just a simple message.



What is the equivalent to motd.tail (appending a small message to the end of the MOTD) that works with Ubuntu 11.04?


More From » 11.04

 Answers
4

To answer the question directly, just edit /etc/update-motd.d/99-footer.



The /etc/update-motd.d/ is a fairly standard config-dump that is ordered by filename. 99-footer is the last thing in there so that gets bolted on last. In Natty by default this just checks to see if there's a file called /etc/motd.tail and if there is, it appends that to the motd:



[ -f /etc/motd.tail ] && cat /etc/motd.tail || true


So you do have two choices. You can either add some more logic in there to just echo some output (this is a shell script, not a textfile after all) or you can create (or edit if you already have one) /etc/motd.tail. Either way is perfectly valid.


[#44585] Monday, June 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rillrage

Total Points: 122
Total Questions: 120
Total Answers: 103

Location: Tokelau
Member since Thu, Aug 26, 2021
3 Years ago
rillrage questions
;