initscripts.postinst always removes /etc/motd.tail

Bug #878412 reported by Ryan Daly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
New
Undecided
Unassigned

Bug Description

I noticed this behavior when upgrading from 10.04.1 -> 10.04.3. The following code (inside initscripts.postinst) will always remove /etc/motd.tail if there is any character (even a single space) in the file. If the file is empty, it appears to be left alone.

<code>
        help_text=$(/etc/update-motd.d/10-help-text 2>/dev/null || true)
        if [ -n "$help_text" ] && fgrep -q "$help_text" /etc/motd.tail
        then
                rm -f /etc/motd.tail
                # Rebuild the motd now that motd.tail has been fixed.
[..]
        fi
</code>

The 'fgrep -q "$help_text" /etc/motd.tail' *always* matches if the file is non-null. This is bad in that it wipes out custom modifications to the motd.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: initscripts 2.87dsf-4ubuntu23
ProcVersionSignature: Ubuntu 2.6.38-11.50-generic-pae 2.6.38.8
Uname: Linux 2.6.38-11-generic-pae i686
NonfreeKernelModules: nvidia wl
Architecture: i386
Date: Wed Oct 19 14:18:15 2011
SourcePackage: sysvinit
UpgradeStatus: Upgraded to natty on 2011-04-28 (173 days ago)

Revision history for this message
Ryan Daly (daly-ctcnet) wrote :
Revision history for this message
Ryan Daly (daly-ctcnet) wrote :

Before posting this bug, I did find that bug #659738 is dealing with duplicate motd's caused by a mis-handling of /etc/motd.tail. It's possible that these bugs are related, but that's not up to me to make that call.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.