Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was wondering how /etc/motd is automatically updated (I'm on Ubuntu 10.04, server edition). I found the update-motd manpage via a web search, but that program is not installed on my machine. The /etc/motd file is regularly updated, however. I just don't know how and how often. When doing a locate motd, following files are listed:

/etc/motd
/etc/update-motd.d
/etc/update-motd.d/00-header
/etc/update-motd.d/10-help-text
/etc/update-motd.d/20-cpu-checker
/etc/update-motd.d/50-landscape-sysinfo
/etc/update-motd.d/90-updates-available
/etc/update-motd.d/91-release-upgrade
/etc/update-motd.d/98-reboot-required
/etc/update-motd.d/99-footer
/home/me/.cache/motd.legal-displayed
/lib/security/pam_motd.so
/usr/bin/motd+shell
/usr/lib/update-manager/release-upgrade-motd
/usr/lib/update-notifier/update-motd-cpu-checker
/usr/lib/update-notifier/update-motd-reboot-required
/usr/lib/update-notifier/update-motd-updates-available
/usr/share/base-files/motd.md5sums
/usr/share/man/man1/motd+shell.1.gz
/usr/share/man/man5/motd.5.gz
/usr/share/man/man5/motd.tail.5.gz
/usr/share/man/man5/update-motd.5.gz
/usr/share/man/man8/pam_motd.8.gz
/usr/share/ubuntu-serverguide/html/C/pam_motd.html
share|improve this question
add comment

1 Answer

up vote 27 down vote accepted

It's updated by pam_motd on login. The update-motd manual page describes this:

   Ubuntu introduced the update-motd framework, by which  the  motd(5)  is
   dynamically assembled from a collection of scripts at login.

   Executable  scripts in /etc/update-motd.d/* are executed by pam_motd(8)
   as the root user at each login, and this information is concatenated in
   /var/run/motd.  The order of script execution is determined by the run-
   parts(8) --lsbsysinit option (basically alphabetical order, with a  few
   caveats).

   On   Ubuntu   systems,  /etc/motd  is  typically  a  symbolic  link  to
   /var/run/motd.
share|improve this answer
4  
you can force with sudo run-parts /etc/update-motd.d/ –  Pete Nov 22 '13 at 19:09
    
@Pete, I tried that command, and although it printed out the relevant information, it did not actually change the text in /etc/motd. Is this expected? –  snapfractalpop Dec 20 '13 at 15:16
2  
@snapfractalpop, Sorry, I was wrong. You can use run-parts for debugging, it will spit out what the resulting motd will be if you are making additions to /etc/update-motd.d. As far as I can tell, the only way to update the file is by triggering pam_motd. On my system it appears to be the services login and sshd (grep pam_motd /etc/pam.d/*) –  Pete Dec 20 '13 at 20:40
3  
@snapfractalpop Yes, that's expected. If you want to update /etc/motd redirect the output there: run-parts /etc/update-motd.d/ | sudo tee /etc/motd –  n.st Jan 4 at 3:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.