Split motd-news config into a new package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
base-files (Ubuntu) |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Xenial |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Bionic |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Focal |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Groovy |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
livecd-rootfs (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Invalid
|
Undecided
|
Unassigned | ||
Groovy |
Invalid
|
Undecided
|
Unassigned | ||
ubuntu-meta (Ubuntu) |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Xenial |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Bionic |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Focal |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Groovy |
Fix Released
|
Undecided
|
Andreas Hasenack |
Bug Description
[Impact]
The motd-news script is largely useless for desktop users, as they rarely login via a text console. It makes more sense for server users.
We can use package dependencies to have the motd-news script enabled on servers, but disabled on desktops, and still handle upgrades. This is the plan:
- move /etc/default/
- have ubuntu-server depend on motd-news-config
- have base-files break current ubuntu-server, so that if base-files if upgraded and ubuntu-server is installed, ubuntu-server will also be upgraded to the new version which has the depends on motd-news-config
Care must be taken to preserve a changed /etc/default/
[Test Case]
a) base-files installed, ubuntu-server installed, unmodified /e/d/motd-news
apt install base-files
- upgrades ubuntu-server
- installs motd-news-config
- /e/d/motd-news remains, motd-news remains enabled
b) base-files installed, ubuntu-server installed, modified /e/d/motd-news
apt install base-files
- upgrades ubuntu-server
- installs motd-news-config
- /e/d/motd-news remains with the original modification
c) base-files installed, ubuntu-server not installed, unmodified /e/d/motd-news
apt install base-files
- upgrades base-files
- removes /e/d/motd-news
- motd-news is disabled
d) base-files installed, ubuntu-server not installed, modified /e/d/motd-news
apt install base-files
- upgrades base-files
- /e/d/motd-news gets renamed to backup
- motd-news is disabled
e) removing motd-news-config will also remove ubuntu-server (since it's a depends, and not a recommends)
f) upgrading just ubuntu-server should pull motd-news-config in, and force-upgrade base-files
g) Removing motd-news-server leaves /e/d/motd-news around; purging motd-news-server removes the /e/d/motd-news config file
h) base-files installed, ubuntu-server installed, removed /e/d/motd-news
- apt install base-files
- upgrades base-files, upgrades ubuntu-server, installs motd-news-config
- /e/d/motd-news is installed with ENABLED=0
i) base-files installed, ubuntu-server NOT installed, removed e/d/motd-news
- apt install base-files
- base-files is upgraded
- no /e/d/motd-news is installed, motd-news remains disabled
j) Perform a release upgrade from the previous ubuntu release to the one being tested while having ubuntu-server NOT installed (or use a desktop install). At the end, motd-news should be disabled. Verify with:
$ sudo /etc/update-
$ (no output)
k) Test that supporting changes for xenial are in place:
i) verify grub-legacy-ec2 is not in the xenial server seed
ii) verify that the rootfs manifest built from the ubuntu-cpc project contains the ubuntu-server package
iii) verify that images built from the ubuntu-cpc project which purge grub-legacy-ec2 have retained ubuntu-server
iv) verify that the base ubuntu-cpc image continues to have grub-legacy-ec2 installed.
[Regression Potential]
This update is about config file ownership transfer: /e/d/motd-news belonged to base-files, now it belongs to motd-news-config. We tried to handle two important cases here:
a) /e/d/motd-news config was changed while it belonged to base-files. For example, an user could have set ENABLED=0. We need to transfer that change to the motd-news-config package when it is installed, otherwise this SRU would jsut re-enabled motd-news. This is handled in d/motd-
b) /e/d/motd-news config file was *removed* while it belonged to base-files. In such a case, a normal upgrade of the package (base-files in this example) would not reinstate the file. Much less this upgrade here, which has an explicit rm_conffile maintscript-helper for it. But the motd-news-config package that could be installed in the transaction would place the default config file back, and the default is ENABLED=1. Thus, a system that had motd-news disabled via removing the config file would now have it re-enabled after the upgrade.
This was trickier to handle, and we do it in base-files's postinst and motd-news-config's postinst. The drawback is that in one scenario, where just base-files is upgraded and /e/d/motd-news was manually removed by the user, there will be a /e/d/motd-
In general, the regression risks here are:
- have motd-news enabled again on a system where it was previously disabled. We tried to envision two ways it would have been disabled (set ENABLED=0, and remove the config file). There are probably others
- differences in dpkg and/or debhelper behavior in older ubuntu releases leading to unexpected results (should be covered by the test cases from this SRU)
- xenial in particular is trickier, because src:base-files there does NOT use debhelper, so many of the things we take for granted have to be done by hand
- have some sort of dpkg postinst or dependency error because of unpredicted scenarios. Certain assumptions are being made, like the renames that dpkg-maintscrip
- the versions I'm breaking/replacing on, and using rm_conffiles on, must be exact. These are the versions today in the archive (2020-08-12):
base-files:
x: 9.4ubuntu4.12
b: 10.1ubuntu2.9
f: 11ubuntu5.1
g: 11ubuntu12 (was 11ubuntu10)
ubuntu-meta:
x: 1.361.4
b: 1.417.4
f: 1.450.1
g: 1.452
Which reflect in these relationships in the updated packages:
Groovy:
ubuntu-server 1.453:
Depends: motd-news-config
base-files 11ubuntu11:
Breaks: ubuntu-server (<< 1.453)
rm_conffile /etc/default/
motd-news-config 11ubuntu11:
Breaks/Replaces: base-files (<< 11ubuntu11)
Focal:
ubuntu-server 1.450.2:
Depends: motd-news-config
base-files 11ubuntu5.2:
Breaks: ubuntu-server (<< 1.450.2)
rm_conffile /etc/default/
motd-news-config 11ubuntu5.2:
Breaks/Replaces: base-files (<< 11ubuntu5.2)
Bionic:
ubuntu-server 1.417.5:
Depends: motd-news-config
base-files 10.1ubuntu2.10:
Breaks: ubuntu-server (<< 1.417.5)
rm_conffile /etc/default/
motd-news-config 10.1ubuntu2.10:
Breaks/Replaces: base-files (<< 10.1ubuntu2.10)
Xenial:
ubuntu-server 1.361.5:
Depends: motd-news-config
base-files 9.4ubuntu4.13:
Breaks: ubuntu-server (<< 1.361.5)
rm_conffile /etc/default/
motd-news-config 9.4ubuntu4.13:
Breaks/Replaces: base-files (<< 9.4ubuntu4.13)
[Other Info]
a) Testcase (i) will leave around an empty /etc/default/
--- a/debian/
+++ b/debian/
@@ -133,7 +133,11 @@ motd_news_
if [ ! -e ${motd_news_config} ]; then
if [ ! -e ${motd_
if [ ! -e ${motd_
- touch ${motd_
+ # The .wasremoved file only matters if ubuntu-server is installed,
+ # because that's what will pull in motd-news-config
+ if dpkg -l ubuntu-server 2>/dev/null | grep -q ^i; then
+ touch ${motd_
+ fi
fi
fi
fi
But deemed it too risky, and not worth further potential regressions. It seemed to work, though, at least for groovy.
b) Currently the xenial cloud images, with the exception of the AWS one, do not have ubuntu-server installed. This means that this SRU will disable motd-news on them, unless ubuntu-server was manually installed for some reason. This includes LXD xenial images as well.
c) The new motd-news-config package has its d/control priority set to "optional", so a release upgrade won't pick it up (presumably the same applies to the installer). I've been told there are archive overrides that might need updating as well: dear SRU team member, please check, or ask an archive admin to check.
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 254 lines (+137/-11)8 files modifieddebian/base-files.maintscript (+2/-0)
debian/changelog (+33/-0)
debian/control (+13/-1)
debian/motd-news-config.install (+1/-0)
debian/motd-news-config.postinst (+55/-0)
debian/postinst.in (+13/-0)
debian/rules (+0/-1)
update-motd.d/50-motd-news (+20/-9)
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 252 lines (+137/-11)8 files modifieddebian/base-files.maintscript (+1/-0)
debian/changelog (+33/-0)
debian/control (+14/-1)
debian/motd-news-config.install (+1/-0)
debian/motd-news-config.postinst (+55/-0)
debian/postinst.in (+13/-0)
debian/rules (+0/-1)
motd/50-motd-news (+20/-9)
- Christian Ehrhardt (community): Approve
- Canonical Server Core Reviewers: Pending requested
-
Diff: 169 lines (+106/-2)7 files modifieddebian/base-files.maintscript (+1/-0)
debian/changelog (+23/-0)
debian/control (+13/-1)
debian/motd-news-config.install (+1/-0)
debian/motd-news-config.postinst (+55/-0)
debian/postinst.in (+13/-0)
debian/rules (+0/-1)
- Bryce Harrington: Approve
- Canonical Server Core Reviewers: Pending requested
-
Diff: 9 lines (+1/-0)1 file modifiedserver (+1/-0)
- Canonical Server Core Reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 2160 lines (+1832/-0) (has conflicts)47 files modifiedSTRUCTURE (+30/-0)
boot (+3/-0)
build-essential (+3/-0)
cloud-image (+11/-0)
desktop (+57/-0)
desktop-default-languages (+17/-0)
desktop-minimal (+175/-0)
desktop-minimal-default-languages (+17/-0)
desktop.minimal-remove (+188/-0)
development (+85/-0)
doc/langpacks.txt (+17/-0)
installer (+3/-0)
lamp-server (+13/-0)
languages/STRUCTURE (+16/-0)
languages/desktop-de (+24/-0)
languages/desktop-en (+27/-0)
languages/desktop-es (+20/-0)
languages/desktop-fr (+19/-0)
languages/desktop-it (+19/-0)
languages/desktop-minimal-de (+11/-0)
languages/desktop-minimal-en (+7/-0)
languages/desktop-minimal-es (+11/-0)
languages/desktop-minimal-fr (+11/-0)
languages/desktop-minimal-it (+11/-0)
languages/desktop-minimal-pt (+11/-0)
languages/desktop-minimal-ru (+11/-0)
languages/desktop-minimal-zh (+23/-0)
languages/desktop-pt (+24/-0)
languages/desktop-ru (+16/-0)
languages/desktop-zh (+9/-0)
live (+45/-0)
mail-server (+17/-0)
minimal (+3/-0)
openssh-server (+10/-0)
print-server (+15/-0)
required (+3/-0)
samba-server (+17/-0)
server (+67/-0)
server-ship (+270/-0)
server-ship-live (+45/-0)
ship (+69/-0)
ship-live (+48/-0)
standard (+3/-0)
supported (+244/-0)
supported-desktop-extra (+62/-0)
supported-kiosk (+6/-0)
wsl (+19/-0)
- Bryce Harrington (community): Approve
- Canonical Server Core Reviewers: Pending requested
-
Diff: 117 lines (+81/-1)4 files modifieddebian/base-files.maintscript (+1/-0)
debian/changelog (+16/-0)
debian/control (+13/-1)
debian/motd-news-config.postinst (+51/-0)
Changed in base-files (Ubuntu Xenial): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in base-files (Ubuntu Bionic): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in base-files (Ubuntu Focal): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in ubuntu-meta (Ubuntu Xenial): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in ubuntu-meta (Ubuntu Bionic): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in ubuntu-meta (Ubuntu Focal): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in ubuntu-meta (Ubuntu Groovy): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in base-files (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in base-files (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in base-files (Ubuntu Focal): | |
status: | New → In Progress |
Changed in ubuntu-meta (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in ubuntu-meta (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in ubuntu-meta (Ubuntu Focal): | |
status: | New → In Progress |
Changed in ubuntu-meta (Ubuntu Groovy): | |
status: | New → In Progress |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: verification-needed |
Changed in livecd-rootfs (Ubuntu Xenial): | |
status: | New → Invalid |
Changed in livecd-rootfs (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in livecd-rootfs (Ubuntu Xenial): | |
status: | Invalid → Triaged |
Changed in livecd-rootfs (Ubuntu Focal): | |
status: | New → Invalid |
Changed in livecd-rootfs (Ubuntu Groovy): | |
status: | New → Invalid |
description: | updated |
tags: |
added: verification-done-xenial removed: verification-needed verification-needed-xenial |
Changed in livecd-rootfs (Ubuntu Xenial): | |
status: | Fix Committed → Fix Released |
This bug was fixed in the package base-files - 11ubuntu11
---------------
base-files (11ubuntu11) groovy; urgency=medium
* Move the /etc/default/ motd-news conffile to the motd-news-config files.maintscri pt: remove /etc/default/ motd-news config file news-config. postinst: motd.d/ 50-motd- news script. news-config. install: /e/d/motd-news is in the news-config package now
package (LP: #1888575):
- d/base-
on upgrade
- d/control: break on ubuntu-server << 1.453 to force an upgrade if
it is installed, which will pull motd-news-config and the conffile
back in
- d/motd-
+ handle the upgrade case where the motd-news config file was
changed while it belonged to base-files
+ disable motd-news if the config file was removed by hand before
the upgrade
- d/postinst.in: signal the motd-news-config package if the
motd-news config file was removed manually before the upgrade
- d/control: new motd-news-config package, carrying the
configuration file for the /etc/update-
- d/rules, d/motd-
motd-
-- Andreas Hasenack <email address hidden> Mon, 10 Aug 2020 21:02:37 +0000