Symlink /etc/motd gets removed on installation or upgrade from Precise
Bug #1282046 reported by
Michael Schaller
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-
true
To me it looks like this issue is present since Saucy and got introduced with version 2.88dsf-41ubuntu1.
Best,
Michael Schaller
tags: | removed: saucy |
To post a comment you must log in.
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.