diff -Nru sysvinit-2.87dsf/debian/changelog sysvinit-2.87dsf/debian/changelog --- sysvinit-2.87dsf/debian/changelog 2010-09-24 02:48:30.000000000 -0700 +++ sysvinit-2.87dsf/debian/changelog 2010-10-28 20:31:02.000000000 -0700 @@ -1,3 +1,11 @@ +sysvinit (2.87dsf-4ubuntu19) maverick-proposed; urgency=low + + * debian/initscripts.postinst (LP: #659738): + - do not create motd.tail from motd on systems using update-motd. + - clean up incorrectly created motd.tail from upgrade to Maverick. + + -- Kees Cook Thu, 28 Oct 2010 20:30:54 -0700 + sysvinit (2.87dsf-4ubuntu18) maverick; urgency=low * Allocate pidof/killall5 omitpid buffers dynamically. 16 is too small diff -Nru sysvinit-2.87dsf/debian/initscripts.postinst sysvinit-2.87dsf/debian/initscripts.postinst --- sysvinit-2.87dsf/debian/initscripts.postinst 2009-10-13 21:15:31.000000000 -0700 +++ sysvinit-2.87dsf/debian/initscripts.postinst 2010-10-28 20:47:23.000000000 -0700 @@ -225,12 +225,21 @@ # # Set up motd stuff, putting variable file in /var/run/ # -if [ ! -f /etc/motd.tail ] +if [ -f /etc/motd.tail ] && \ + dpkg --compare-versions "$PREV_VER" lt "2.87dsf-4ubuntu19" then - if [ -f /etc/motd ] + # If the standard help-text from update-motd is found in the + # /etc/motd.tail file, it has been created from the old /etc/motd + # file during the initscripts 2.87dsf-4ubuntu18 postinst script, + # so it should be removed. Give up if the help-text template + # generator is missing or produces no output. + help_text=$(/etc/update-motd.d/10-help-text 2>/dev/null || true) + if [ -n "$help_text" ] && grep -q "$help_text" /etc/motd.tail then - sed 1d /etc/motd > /etc/motd.tail - [ -s /etc/motd.tail ] || rm -f /etc/motd.tail + rm -f /etc/motd.tail + # Rebuild the motd now that motd.tail has been fixed. + run-parts --lsbsysinit /etc/update-motd.d > /var/run/motd.new \ + && mv /var/run/motd.new /var/run/motd || true fi fi if [ ! -f /var/run/motd ]