Symlink /etc/motd gets removed on installation or upgrade from Precise

Bug #1282046 reported by Michael Schaller
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hi everyone,

The postinst maintainer script of the initscripts package contains this code:
if dpkg --compare-versions "$PREV_VER" lt "2.88dsf-24" ; then
   if [ -L /etc/motd ] && [ "$(readlink /etc/motd)" = "/var/run/motd" ]; then
       rm /etc/motd
...

This code is problematic as it removes /etc/motd for new installs and during an upgrade from Precise.
New installs:
$ dpkg --compare-versions "" lt "2.88dsf-24" && echo true || echo false
true

Upgrade from Precise:
$ dpkg --compare-versions "2.88dsf-13.10ubuntu11.1" lt "2.88dsf-24" && echo true || echo false
true

To me it looks like this issue is present since Saucy and got introduced with version 2.88dsf-41ubuntu1.

Best,

Michael Schaller

Tags: trusty
Revision history for this message
Steve Langasek (vorlon) wrote :

What exactly is problematic about this? The /etc/motd symlink is removed on upgrade because it is no longer being used by the stock PAM config, in favor of reading /run/motd.dynamic directly. (This change was driven by the sysvinit maintainer in Debian; the previous setup worked fine, but given that Debian has changed there doesn't seem to be any benefit to *not* following suit.

If you had an existing /etc/motd which was not a symlink, it would be preserved and would still be displayed on login. If you had an /etc/motd.tail that was being appended to /run/motd by /etc/update-motd.d/99-footer, this would now be handled by a separate invocation of pam_motd from the relevant pam config.

If there is software in Ubuntu that's not displaying the correct output as a result of this change, please let us know what that is. But this doesn't appear to be a bug in the initscripts package's behavior.

Changed in sysvinit (Ubuntu):
status: New → Incomplete
Revision history for this message
Michael Schaller (misch-9) wrote :

Hi Steve,

I see. So the symlink removal intentional. Then something else must be broken on Trusty as I don't get a motd message on login on a VT or via SSH on a freshly installed machine. Both /run/motd and /run/motd.dynamic are present on Trusty. As soon as I add the symlink /etc/motd -> /run/motd I also get the motd message on login/ssh.

Can it be that there is an issue with pam_motd in Trusty so that /run/motd.dynamic isn't displayed?

Best,

Michael

tags: removed: saucy
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for sysvinit (Ubuntu) because there has been no activity for 60 days.]

Changed in sysvinit (Ubuntu):
status: Incomplete → Expired
Revision history for this message
dh (dcharvey) wrote :

Any further detail I can add here to move this along? Trying to work out the most elegant workaround in the mean time whilst the pam module is still apparently not functioning as intended.

According to the man page for the current pam_motd (included in libpam-modules Version: 1.1.8-1ubuntu2
 ), it's still reading from /etc/motd

Changed in sysvinit (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Steve Langasek (vorlon) wrote :

> Any further detail I can add here to move this along?

Well, if you expect any movement you will certainly need to provide more detail, because this is working as expected here.

Revision history for this message
dh (dcharvey) wrote :

apologies, seems something broken in our setup and cannot reproduce on vanilla.
Marking as invalid.

Changed in sysvinit (Ubuntu):
status: Confirmed → Invalid
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.