UpdateMotd
Overview
Created: 2008-08
Contributors: DustinKirkland
Packages affected: update-motd
Summary
This package seeks to make the /etc/motd (Message of the Day) more dynamic and valuable, by providing a simple, clean framework for defining scripts whose output will regularly be written to /etc/motd.
Rationale
The message currently printed on all logins (console, ssh, etc) is rather bland, uninteresting, and useless.
It would be rather useful to provide a simple directory for system administrators to drop scripts whose output would generate a more dynamic and informative message-of-the-day.
Use Cases
Part of the inspiration for the update-motd package is the mythtv-status package. This package consists of a perl script that queries a MythTV backend, and generates a dynamic /etc/motd, showing how much disk space is available, which tuners/encoders are in operation, and what the next scheduled recording is. This package could easily be modified to use the update-motd framework.
Additionally, the Landscape project seeks to provide some useful information to Ubuntu users upon login. There are cases where this could be handled by scripts in /etc/profile.d, however, there are reasons why it might be better to use an update-motd approach.
Design
The basic design is rather simple. The update-motd package creates a directory, /etc/update-motd.d, and installs a cronjob, /etc/cron.d/update-motd, which calls /usr/sbin/update-motd every 10 minutes (by default).
/usr/sbin/update-motd uses run-parts to execute each script in /etc/update-motd.d in lexigraphic order, concatenating the results with the message-of-the-day header, /etc/motd.tail.
In this way, users, or even other packages can drop scripts into /etc/update-motd.d to affect the MOTD.
Implementation
As of 2008-09, this package is implemented and included in Intrepid Universe.
Outstanding Issues
There exists a Main Inclusion Report, for moving this package to Main:
Testing
- sudo apt-get install update-motd
create a script, such as /etc/update-motd.d/10-stats
#!/bin/sh echo date echo who echo uptime
- Wait ~10 minutes and then log in
Discussion, Questions, Answers
Please leave questions and discussion points below, sign your comments with your wiki-name, and subscribe to this page:
https://wiki.ubuntu.com/UpdateMotd?action=subscribe subscribe to this page
Q: Is it possible to completely disable the MOTD functions, so that none of this background processing ever takes place?
References
UpdateMotd (last edited 2010-05-03 01:33:07 by 96)