Merge ~ahasenack/ubuntu/+source/base-files:focal-handle-was-removed-1895302 into ubuntu/+source/base-files:ubuntu/devel
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | ~ahasenack/ubuntu/+source/base-files:focal-handle-was-removed-1895302 | ||||
Merge into: | ubuntu/+source/base-files:ubuntu/devel | ||||
Diff against target: |
234 lines (+95/-0) (has conflicts) 9 files modified
debian/base-files.maintscript (+4/-0) debian/changelog (+40/-0) debian/control (+9/-0) debian/motd-news-config.postinst (+8/-0) debian/postinst.in (+12/-0) etc/issue (+4/-0) etc/issue.net (+4/-0) etc/lsb-release (+6/-0) etc/os-release (+8/-0) Conflict in debian/base-files.maintscript Conflict in debian/changelog Conflict in debian/control Conflict in debian/motd-news-config.postinst Conflict in debian/postinst.in Conflict in etc/issue Conflict in etc/issue.net Conflict in etc/lsb-release Conflict in etc/os-release |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Canonical Server Core Reviewers | Pending | ||
Canonical Server | Pending | ||
Review via email: mp+390765@code.launchpad.net |
This proposal has been superseded by a proposal from 2020-09-15.
Description of the change
Handle the creation and removal of the /etc/default/
I have two choices here:
a) handle the creation and removal of that file (this MP)
b) give up trying to handle that file, and just cleanup: https:/
To recap, the idea behind /e/d/motd-
- user had base-files and ubuntu-server from before the split, meaning /e/d/motd-news is a config file part of base-files
- motd-news is enabled (ENABLED=1 in /e/d/motd-news)
- in an erroneous attempt to disable the service, the user removes the /e/d/motd-news file. ENABLED doesn't get set, and the motd-news script just exits
In the above scenario, without the .wasremoved feature, if the user upgraded to the updated packages with the spit, then /e/d/motd-news would be reinstated because it's now part of the motd-news-config package. This would re-enable the motd-news feature, something we want to be careful about.
The implementation suffers from some problems, though:
- a fresh install of base-files, like done via debootstrap, will create the .wasremoved file. If you then install motd-news-config (via apt install ubuntu-server, for example), the motd-news-config postinst fill find the .wasremoved file, see it's a fresh install of motd-news-config, and disable motd-news. This is the current situation in the groovy lxd images, for example
- if you just have base-files installed, no motd-news-config, and then reinstall or upgrade base-files, the .wasremoved will be created
To address those, this MP (choice (a)) does:
- motd-news-config postinst: always remove the .wasremoved file in configure if found, regardless if /etc/default/
- base-files postinst: guard the creation of .wasremoved with:
- Only during an upgrade
- Only if ubuntu-server is installed (via a dpkg -l check)
If a user again decides to erroneously disable motd-news by removing /e/d/motd-news, then an upgrade of base-files, motd-news-config and ubuntu-server will go through the creation and removal of the .wasremoved file, but no new /e/d/motd-news config file will be created or changed, and motd-news will at least remain disabled. But it's extra unnecessary churn, as the corner case it handles only happens when upgrading from before the motd-news-config split.
The dpkg -l check for ubuntu-server relies on ubuntu-server depending (and not just recommending) on motd-news-config. I'm a bit afraid of the dpkg -l call in base-files' postinst:
- Locking issues?
- I'm checking for ^i, should I be looking for other cases? Other flags?
- At least dpkg is already installed, as I see other calls to it in the same postinst
If we find other issues in these maintainer scripts regarding the motd-news-config split, or introduce new ones with these changes, it will get harder and harder to fix each time. That's why I also have to consider simply giving up and living with the corner case we tried to handle in the beginning, and that is this diff: https:/
I have PPAs for both scenarios, with groovy and focal packages (just not yet bionic or xenial):
Give up handling of .wasremoved: https:/
Try to fix handling of .wasremoved: https:/
May the best one win :)
Unmerged commits
- 8a66e5c... by Andreas Hasenack
- 6fcd366... by Andreas Hasenack
- 9b68a73... by Andreas Hasenack
- 03931a2... by Andreas Hasenack
- 6f3fbdb... by Andreas Hasenack
- 1c5b4b9... by Andreas Hasenack
- d06cb18... by Steve Langasek
- c4e4748... by Andreas Hasenack
- d217183... by Andreas Hasenack
- 78f2dc7... by Andreas Hasenack