[Bug 1888575] Re: Split motd-news config into a new package
Andreas Hasenack
1888575 at bugs.launchpad.net
Tue Aug 25 22:05:31 UTC 2020
Xenial verification
Versions we are handling:
base-files 9.4ubuntu4.12 -> 9.4ubuntu4.13
ubuntu-server 1.361.4 -> 1.361.5
motd-news-config n/a -> 9.4ubuntu4.13
Note that in xenial, at the moment, ubuntu-server is not pre-installed
in the images.
This verification is quite long, given the amount of tests involved.
TL;DR All tests from (a) to (j) passed as required.
xenial verification succeeded.
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
starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
ii ubuntu-server 1.361.4 amd64 The Ubuntu Server system
unmodified config:
ubuntu at xenial-motd-news-split:~$ dpkg -s base-files | grep /etc/default/motd-news; echo -n ' '; md5sum /etc/default/motd-news | awk '{print $2,$1}'
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
motd-news enabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
ubuntu at xenial-motd-news-split:~$ echo $?
0
apt install base-files result:
The following NEW packages will be installed:
motd-news-config
The following packages will be upgraded:
base-files ubuntu-server
2 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
new state:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
ii motd-news-config 9.4ubuntu4.13 all Configuration for motd-news shipped in base-files
ii ubuntu-server 1.361.5 amd64 The Ubuntu Server system
motd-news remains enabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
0
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
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
ii ubuntu-server 1.361.4 amd64 The Ubuntu Server system
Modified config file, to disable motd-news:
ubuntu at xenial-motd-news-split:~$ sudo sed -i 's,^ENABLED=.*,ENABLED=0,' /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ dpkg -s base-files | grep /etc/default/motd-news; echo -n ' '; md5sum /etc/default/motd-news | awk '{print $2,$1}'
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
/etc/default/motd-news e2d38a5c7454c64a967d6a2fe033558f
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
base-files install result:
The following NEW packages will be installed:
motd-news-config
The following packages will be upgraded:
base-files ubuntu-server
2 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
new state:
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
ii motd-news-config 9.4ubuntu4.13 all Configuration for motd-news shipped in base-files
ii ubuntu-server 1.361.5 amd64 The Ubuntu Server system
motd-news remains disabled:
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
-rw-r--r-- 1 root root 682 Aug 25 21:15 /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
config file moved to the motd-news-config package and the modification was preserved:
ubuntu at xenial-motd-news-split:~$ dpkg -s motd-news-config | grep /etc/default/motd-news; echo -n ' '; md5sum /etc/default/motd-news | awk '{print $2,$1}'
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
/etc/default/motd-news e2d38a5c7454c64a967d6a2fe033558f
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
initial state:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching ubuntu-server
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
unmodified config:
ubuntu at xenial-motd-news-split:~$ dpkg -s base-files | grep /etc/default/motd-news; echo -n ' '; md5sum /etc/default/motd-news | awk '{print $2,$1}'
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
motd-news enabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
0
Installing base-files pulls nothing else in:
The following packages will be upgraded:
base-files
1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
new state shows just base-files:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
config file is gone:
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
ls: cannot access '/etc/default/motd-news*': No such file or directory
and motd-news is disabled as a result;
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
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
starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching ubuntu-server
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
modified config file, disabling the service:
ubuntu at xenial-motd-news-split:~$ sudo sed -i 's,^ENABLED=.*,ENABLED=0,' /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ dpkg -s base-files | grep /etc/default/motd-news; echo -n ' '; md5sum /etc/default/motd-news | awk '{print $2,$1}'
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
/etc/default/motd-news e2d38a5c7454c64a967d6a2fe033558f
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
installing base-files pulls in nothing else:
The following packages will be upgraded:
base-files
1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
new state:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
Config file is renamed:
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
-rw-r--r-- 1 root root 682 Aug 25 21:22 /etc/default/motd-news.dpkg-bak
motd-news is disabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
e) removing motd-news-config will also remove ubuntu-server (since it's a depends, and not a recommends)
starting point is with the packages from proposed installed:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
ii motd-news-config 9.4ubuntu4.13 all Configuration for motd-news shipped in base-files
ii ubuntu-server 1.361.5 amd64 The Ubuntu Server system
Removing motd-news-config also removes ubuntu-server:
The following packages will be REMOVED:
motd-news-config ubuntu-server
0 upgraded, 0 newly installed, 2 to remove and 9 not upgraded.
After this operation, 63.5 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 25792 files and directories currently installed.)
Removing ubuntu-server (1.361.5) ...
Removing motd-news-config (9.4ubuntu4.13) ...
f) upgrading just ubuntu-server should pull motd-news-config in, and force-upgrade base-files
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
ii ubuntu-server 1.361.4 amd64 The Ubuntu Server system
Upgrading ubuntu-server pulls in motd-news-config and also upgrades base-files:
ubuntu at xenial-motd-news-split:~$ sudo apt install ubuntu-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
base-files motd-news-config
The following NEW packages will be installed:
motd-news-config
The following packages will be upgraded:
base-files ubuntu-server
2 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
g) Removing motd-news-server leaves /e/d/motd-news around; purging motd-news-server removes the /e/d/motd-news config file
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
ii motd-news-config 9.4ubuntu4.13 all Configuration for motd-news shipped in base-files
ii ubuntu-server 1.361.5 amd64 The Ubuntu Server system
Config file present and unmodified:
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
-rw-r--r-- 1 root root 682 Aug 7 20:02 /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ dpkg -s motd-news-config | grep /etc/default/motd-news; echo -n ' '; md5sum /etc/default/motd-news | awk '{print $2,$1}'
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
/etc/default/motd-news c08a329a603b640095da5ffe4e73491c
motd-news enabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
0
g1) removing motd-news-config leaves config file in place and motd-news remains enabled:
ubuntu at xenial-motd-news-split:~$ sudo apt remove motd-news-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
motd-news-config ubuntu-server
0 upgraded, 0 newly installed, 2 to remove and 9 not upgraded.
After this operation, 63.5 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 25792 files and directories currently installed.)
Removing ubuntu-server (1.361.5) ...
Removing motd-news-config (9.4ubuntu4.13) ...
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
-rw-r--r-- 1 root root 682 Aug 7 20:02 /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news
--force;echo $?
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
0
g2) purging motd-news-config removes config file and thus disables motd-news:
ubuntu at xenial-motd-news-split:~$ sudo apt purge motd-news-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
motd-news-config* ubuntu-server*
0 upgraded, 0 newly installed, 2 to remove and 9 not upgraded.
After this operation, 63.5 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 25792 files and directories currently installed.)
Removing ubuntu-server (1.361.5) ...
Removing motd-news-config (9.4ubuntu4.13) ...
Purging configuration files for motd-news-config (9.4ubuntu4.13) ...
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
ls: cannot access '/etc/default/motd-news*': No such file or directory
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
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
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
ii ubuntu-server 1.361.4 amd64 The Ubuntu Server system
ubuntu at xenial-motd-news-split:~$ sudo rm /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
ls: cannot access '/etc/default/motd-news*': No such file or directory
motd-news disabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
Upgrading base-files also upgrades ubuntu-server and pulls in motd-news-config:
ubuntu at xenial-motd-news-split:~$ sudo apt install base-files
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
motd-news-config ubuntu-server
The following NEW packages will be installed:
motd-news-config
The following packages will be upgraded:
base-files ubuntu-server
2 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
/e/d/motd-news is reinstalled but disabled with a note:
ubuntu at xenial-motd-news-split:~$ head -n 7 /etc/default/motd-news
# Enable/disable the dynamic MOTD news service
# This is a useful way to provide dynamic, informative
# information pertinent to the users and administrators
# of the local system
# Changed by motd-news-config.postinst:
# config file was manually removed - disable the service
ENABLED=0
And motd-news remains disabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
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
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching ubuntu-server
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
No config:
ubuntu at xenial-motd-news-split:~$ sudo rm /etc/default/motd-news
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
ls: cannot access '/etc/default/motd-news*': No such file or directory
motd-news thus disabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
Upgrading base-files:
ubuntu at xenial-motd-news-split:~$ sudo apt install base-files
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
base-files
1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Just the empty ".wasremoved" file in place:
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
-rw-r--r-- 1 root root 0 Aug 25 21:37 /etc/default/motd-news.wasremoved
motd-news remains disabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
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-motd.d/50-motd-news --force
$ (no output)
j1) release-upgrade without the candidate packages from xenial-proposed installed, and ubuntu-server not installed as requested
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching ubuntu-server
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.12 amd64 Debian base system miscellaneous files
motd-news is enabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
0
Added a sources.list line for bionic-proposed.
Final state:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 10.1ubuntu2.10 amd64 Debian base system miscellaneous files
That base-files comes from bionic-proposed:
ubuntu at xenial-motd-news-split:~$ apt-cache policy base-files
base-files:
Installed: 10.1ubuntu2.10
Candidate: 10.1ubuntu2.10
Version table:
*** 10.1ubuntu2.10 500
500 http://br.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
and motd-news is disabled as expected:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
j2) release-upgrade with the candidate packages from xenial-proposed installed, and xenial-proposed disabled, and ubuntu-server not installed as requested
Starting point:
ubuntu at xenial-motd-news-split:~$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 9.4ubuntu4.13 amd64 Debian base system miscellaneous files
no motd-news config, and thus the service is disabled:
ubuntu at xenial-motd-news-split:~$ ll /etc/default/motd-news*
ls: cannot access '/etc/default/motd-news*': No such file or directory
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
Added a sources.list line for bionic-proposed.
Final state:
$ dpkg -l base-files ubuntu-server motd-news-config | grep ^ii
dpkg-query: no packages found matching motd-news-config
ii base-files 10.1ubuntu2.10 amd64 Debian base system miscellaneous files
Which is from bionic-proposed:
*** 10.1ubuntu2.10 500
500 http://br.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
motd-news remains disabled:
ubuntu at xenial-motd-news-split:~$ sudo /etc/update-motd.d/50-motd-news --force;echo $?
0
** Tags removed: verification-needed-bionic verification-needed-xenial
** Tags added: verification-done-bionic verification-done-xenial
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-meta in Ubuntu.
https://bugs.launchpad.net/bugs/1888575
Title:
Split motd-news config into a new package
Status in base-files package in Ubuntu:
Fix Released
Status in ubuntu-meta package in Ubuntu:
Fix Released
Status in base-files source package in Xenial:
Fix Committed
Status in ubuntu-meta source package in Xenial:
Fix Committed
Status in base-files source package in Bionic:
Fix Committed
Status in ubuntu-meta source package in Bionic:
Fix Committed
Status in base-files source package in Focal:
Fix Committed
Status in ubuntu-meta source package in Focal:
Fix Committed
Status in base-files source package in Groovy:
Fix Released
Status in ubuntu-meta source package in Groovy:
Fix Released
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/motd-news from base-files into a new binary package (motd-news-config, produced by src:base-files)
- 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/motd-news when
the upgrade installs the new motd-news-config package. For example, on
a server that has set ENABLED=0 in /etc/default/motd-news and upgrades
to the new base-files and ubuntu-server, and gets the new motd-config-
news package, ENABLED=0 must remain set.
[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-motd.d/50-motd-news --force
$ (no output)
[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-news-config.postinst's configure case.
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-news.wasremoved leftover empty file (see "other info" below for details).
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-maintscript-helper does, and that the filename /etc/default/motd-news.wasremoved that I'm touching and verifying is really mine and not something that was there already.
- 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 11ubuntu11~ base-files
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 11ubuntu5.2~ base-files
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 10.1ubuntu2.10~ base-files
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 9.4ubuntu4.13~ base-files
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/motd-news.wasremoved file, created by the base-files postinst. This file is removed by the motd-news-config postinst, but since that package doesn't get installed in that particular scenario, the file remains. I toyed with the idea of adding an extra check to base-file's postinst, like this:
--- a/debian/postinst.in
+++ b/debian/postinst.in
@@ -133,7 +133,11 @@ motd_news_config="/etc/default/motd-news"
if [ ! -e ${motd_news_config} ]; then
if [ ! -e ${motd_news_config}.dpkg-remove ]; then
if [ ! -e ${motd_news_config}.dpkg-backup ]; then
- touch ${motd_news_config}.wasremoved
+ # 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_news_config}.wasremoved
+ 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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/1888575/+subscriptions
More information about the foundations-bugs
mailing list