Wednesday, September 27, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  6] [ 0]  / answers: 1 / hits: 8395  / 11 Months ago, tue, december 6, 2022, 12:15:01

I've just made the transition to Ubuntu Linux 12.10 and I want to properly set up my first motd. I've run the following below and noticed that I only have one motd file instead of having a secondary file called motd.tail that most Ubuntu versions seem to have. Should I create backup copy the motd file and then write to that file, or write to the file directly? Also, once I've written to this file do I need to make it executable to display the message?

ls -l motd* // output: motd -> /var/run/motd

More From » motd


As you've seen, /etc/motd is a symlink to /var/run/motd.

/var/run/motd is updated by a series of scripts that you'll find in the /etc/update-motd.d directory. The last of those scripts, 99-footer prints the contents of /etc/motd.tail, if it exists, and the output of 99-footer is appended to /var/run/motd.

A comment in /etc/update-motd.d/99-footer says:

# motd.tail is reserved for the admin to append static
# trailing information to a dynamically generated
# /etc/motd.
# To add dynamic information, add a numbered
# script to /etc/update-motd.d/

So /etc/motd.tail is the usual way to append static content to /etc/motd.

Of course, if you prefer, you can change all that, for example by making /etc/motd a standalone file with whatever contents you like. But then you'd lose the useful information added by the existing scripts.

And no, you don't need to make either motd or motd.tail executable, since they're not meant to be executed.

[#32345] Tuesday, December 6, 2022, 11 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 129
Total Questions: 125
Total Answers: 127

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
9 Months ago