[Pkg-sysvinit-devel] Bug#624391: initscripts: postinst dupes /etc/motd into /etc/motd.tail

Andrew Pollock apollock at debian.org
Sat Apr 30 16:51:00 UTC 2011


On Sat, Apr 30, 2011 at 10:09:22PM +1000, Kel Modderman wrote:
> On Thu, 28 Apr 2011 02:44:15 PM Andrew Pollock wrote:
> > Package: initscripts
> > Version: 2.86.ds1-61
> > Severity: minor
> > 
> > I encountered this bug on Ubuntu 10.04, but the maintainer script in
> > question appears unmodified from Debian.
> > 
> > Basically, the postinst of initscripts appears to copy the contents of
> > /etc/motd into /etc/motd.tail, if it doesn't exist.
> > 
> > This appears to be benign on Debian, but on Ubuntu, which will dynamically
> > create an /etc/motd out of shell fragments in /etc/update-motd.d and
> > /etc/motd.tail, it has the undesired effect of caused duplicated stale
> > content.
> > 
> > Ubuntu recently pushed an updated initscripts package to 10.04, which
> > caused the problem I describe.
> > 
> > More information in
> > https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/634387
> > 
> > In short, I don't think the postinst should be creating an /etc/motd.tail
> > if one doesn't exist already.
> 
> I do not completely understand this statement. Do you mean: postinst should 
> never create /etc/motd.tail at all?

Right. Unless the intended purpose of /etc/motd.tail differs between Debian
and Ubuntu? From reading motd.tail(5), perhaps the answer is yes, they do
have different purposes... Although the manpages say the same thing on
Debian and Ubuntu, the 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.

which I think is consistent with the spirit of how it's intended to be used
on Debian as well, isn't it?
 
> > I also don't think it should go putting anything in it if it does exist.
> 
> Tend to agree with this one.
> 
> I'd be happy to look at/apply a patch if you could please whip one up?

Okay, but what's the agreed course of action?

Currently we have:

f [ ! -f /etc/motd.tail ]
then
        if [ -f /etc/motd ]
        then
                sed 1d /etc/motd > /etc/motd.tail
                [ -s /etc/motd.tail ] || rm -f /etc/motd.tail
        fi
fi

Under what circumstances would the postinst want to be messing around with
/etc/motd.tail?

regards

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20110430/fce43ab8/attachment-0002.pgp>


More information about the Pkg-sysvinit-devel mailing list