update-motd python daemon [was: [ubuntu/karmic] update-motd 2.0-0ubuntu1 (Accepted)]

Dustin Kirkland kirkland at ubuntu.com
Tue Jul 14 03:14:39 BST 2009


On Mon, Jul 13, 2009 at 1:12 PM, Steve
Langasek<steve.langasek at ubuntu.com> wrote:
> On Mon, Jul 13, 2009 at 08:14:48AM +0200, Martin Pitt wrote:
>> Hello,
>
>> Dustin Kirkland [2009-07-12 22:40 -0000]:
>> >     - rewrite update-motd as a python daemon, rather than a series of
>> >       difficult-to-manage cronjobs
>
>> Hm, in terms of startup costs, memory/RAM usage, and cost/benefit
>> ratio of used resources vs. output, a permanently running Python
>> daemon for modifying a text file every now and then is magnitudes
>> worse than some cron jobs IMHO.
>
>> Instead of imposing this cost on everyone, could this not just become
>> an "optional" PAM module, which updates motd whenever someone actually
>> logs into the machine?
>
> Better than "a PAM module" would be to integrate it with the pam_motd we use
> for displaying the motd in the first place.

Martin (and others) expressed concern with update-motd as a daemon.
Previously, others expressed concern with update-motd running from
cronjobs.  The consensus seems to point toward collating this dynamic
MOTD information at login, rather than in the background.

I spent first half of today rewriting update-motd to actually use a
script in /etc/profile.d to collect and display this information.  I
released this as update-motd-3.0 (which eliminates the daemon and
fixes a couple of upgrade issues).

And then I saw Steve's note about integrating this into pam_motd,
which, I think ultimately makes the most sense.

For more information and progress, see:
 * https://bugs.edge.launchpad.net/ubuntu/+source/pam/+bug/399071

To that bug, I have attached a patch that would add update-motd's
functionality directly into the pam_motd module.  Basically, pam_motd
executes `run-parts /etc/update-motd.d > /var/run/motd` at login.
Thus, this data would be collected at each login, would be current at
login time, and would be cached in /etc/motd -> /var/run/motd for
subsequent access post-login.

In addition to providing "fresh" system information, a MOTD
dynamically generated from /etc/update-motd.d/* scripts could also be
internationalized, if those scripts used gettext calls.

One implication is that there is no longer (hourly, daily, weekly,
monthly) support in the /etc/update-motd.d/* directory.  As far as I
can tell, this only affects two packages (update-notifier,
update-manager), and I have committed fixes to bzr for both of these:
 * http://bazaar.launchpad.net/~ubuntu-core-dev/update-notifier/ubuntu/revision/486
 * http://bazaar.launchpad.net/~ubuntu-core-dev/update-manager/main/revision/1468
These commits are awaiting review by Michael Vogt before releasing.

Also, I committed two changes to base-files:
 * Created /etc/update-motd.d/00-header: This script is what seeds the
header in the beginning of the "run-parts" call; I set it to the stock
uname + motd.tail (as found in bootlogs.sh), however, this gives us
(or a system administrator) a solid place to tweak this as necessary
 * And Loosely related to this were my efforts to clean up the legal
disclaimer of warranty in the MOTD.  I had previously added a script
to /etc/profile.d (in the base-files) package.  However, this too
would be handled better in pam_motd.  The pam_motd patch handles this
too.  So legal.sh was dropped from base-files

The good news, I think, is that once the pam_motd patch is accepted,
we can eliminate the update-motd package entirely.  At which point,
we'll need to drop the update-motd dependency in:
 * update-notifier-common
 * update-manager-core
 * landscape-common

Thanks for your careful review, Martin & Steve.  Helping make Ubuntu
better and faster ;-)

Cheers,
:-Dustin



More information about the ubuntu-devel mailing list