On Fri, May 21, 2010 at 11:27:35AM +0200, Santiago Vila wrote:
> On Sat, 8 May 2010, Steve Langasek wrote:
> 
> > On Wed, May 05, 2010 at 06:38:49PM +0200, Julian Andres Klode wrote:
> > > > On Wed, May 05, 2010 at 02:23:16AM +0200, Jean-Christophe Dubacq wrote:
> > > > > This one was a bit hard to track down. After a while, my /etc/motd
> > > > > would be reduced to one empty line or info about packages updates.
> > 
> > > > > It happens that pam_motd executes /etc/update-motd.d if it exists 
> > > > > (with
> > > > > run-parts) but nothing in this directory rebuilds the standard motd.
> > > I did not know this.
> > 
> > > > > This could be a bug in update-notifier-common, or in pam (not 
> > > > > providing
> > > > > a small file such as:
> > > > > ebene:~$ cat /etc/update-motd.d/00-header 
> > > > > #!/bin/sh
> > > > > uname -snrvm
> > > > > [ -f /etc/motd.tail ] && cat /etc/motd.tail
> > 
> > > > Yes, I think this is a bug in update-notifier-common for shipping this 
> > > > file
> > > > in Debian without having an appropriate versioned dep on something that
> > > > builds the main part of the motd.  Reassigning.
> > > Is there something that builds it?
> > 
> > In Debian, I don't think there is yet (and if not, update-notifier-common
> > should avoid shipping this code in Debian).  In Ubuntu,
> > /etc/update-motd.d/00-header is provided as part of base-files, since that's
> > the package which owns /etc/motd historically.
> 
> In Debian, the file /etc/motd is created the very first time
> base-files is installed (by debootstrap) in this way:
> 
> if [ "$1" = "configure" ] && [ "$2" = "" ]; then
>   [...]
>   install_from_default /usr/share/base-files/motd          /etc/motd
> 
> Also, on upgrades, base-files tries to upgrade the file in this way:
> 
> if [ "$1" = "configure" ] && [ "$2" != "" ]; then
>   if [ -f /etc/motd ]; then
>     oldmd=`awk 'NR > 2' /etc/motd | md5sum | awk '{print $1}'`
>     newmd=`awk 'NR > 2' /usr/share/base-files/motd | md5sum | awk '{print 
> $1}'`
>     if [ "$oldmd" != "$newmd" ]; then
>       if grep -q "$oldmd" /usr/share/base-files/motd.md5sums; then
>         awk 'NR <= 2' /etc/motd > /etc/motd.new
>         awk 'NR > 2' /usr/share/base-files/motd >> /etc/motd.new
>         mv /etc/motd /etc/motd.old
>         mv /etc/motd.new /etc/motd
>       fi
>     fi
>   fi
> fi
> 
> 
> If anybody is going to break this I will appreciate that it could be
> discussed first, at least.

Thing is, I did not expect those files to do anything at all on
a Debian system, that's why I kept them. It would be really nice
if pam could start using update-motd.d, so the motd can be updated
when package updates are available.

Otherwise, I would have to disable this feature in
update-notifier-common.
-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Attachment: pgpSQqNqUGalO.pgp
Description: PGP signature

Reply via email to