[Bug 2015420] Re: motd: can't disable esm-related messages
Renan Rodrigo
2015420 at bugs.launchpad.net
Fri Mar 15 23:09:27 UTC 2024
Now, to the actual functionality test on Jammy:
Jammy is an LTS release still supported, so messages about esm-apps will be present in MOTD by default.
After creating the marker file and triggering an update of MOTD, those messages disappear, but the updates count remains.
root at jammy-sut:~# apt policy update-notifier-common
update-notifier-common:
Installed: 3.192.54.8
Candidate: 3.192.54.8
Version table:
*** 3.192.54.8 500
500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
100 /var/lib/dpkg/status
3.192.54.6 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
3.192.54 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
root at jammy-sut:~# run-parts /etc/update-motd.d/
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-21-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Fri Mar 15 23:08:15 UTC 2024
System load: 1.2568359375
Usage of /home: unknown
Memory usage: 0%
Swap usage: 0%
Temperature: 86.0 C
Processes: 24
Users logged in: 0
IPv4 address for eth0: 10.46.74.160
IPv6 address for eth0: fd42:f539:1893:d366:216:3eff:fea1:40fb
Expanded Security Maintenance for Applications is not enabled.
25 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
root at jammy-sut:~# touch /var/lib/update-notifier/hide-esm-in-motd
root at jammy-sut:~# rm /var/lib/update-notifier/updates-available
root at jammy-sut:~# apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-proposed InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
27 packages can be upgraded. Run 'apt list --upgradable' to see them.
root at jammy-sut:~# run-parts /etc/update-motd.d/
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-21-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Fri Mar 15 23:08:15 UTC 2024
System load: 1.2568359375
Usage of /home: unknown
Memory usage: 0%
Swap usage: 0%
Temperature: 86.0 C
Processes: 24
Users logged in: 0
IPv4 address for eth0: 10.46.74.160
IPv6 address for eth0: fd42:f539:1893:d366:216:3eff:fea1:40fb
25 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
I am marking this bug verification-done on Jammy, and verification-done overall as this is the last release to test.
** Tags removed: verification-needed-jammy
** Tags added: verification-done-jammy
** Tags removed: verification-needed
** Tags added: verification-done
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/2015420
Title:
motd: can't disable esm-related messages
Status in update-notifier package in Ubuntu:
In Progress
Status in update-notifier source package in Xenial:
Fix Committed
Status in update-notifier source package in Bionic:
Fix Committed
Status in update-notifier source package in Focal:
Fix Committed
Status in update-notifier source package in Jammy:
Fix Committed
Bug description:
[ Impact ]
If ESM Infra/Apps is available for a system, users will always see
messages related to those Ubuntu Pro services in their MOTDs. As
stated in the original description, there have been complaints on how
hard it is to disable those messages - we have users who don't want
Pro and don't want to be reminded of Pro all the time.
The fix here is making it easier for people to disable the ESM related
messages in the update-related MOTD, by giving them a way to opt-out.
Users will have the option to create the /var/lib/ubuntu-
advantage/hide-esm-in-motd marker file, causing the /usr/lib/update-
notifier/update-motd-updates-available script to include a --no-esm-
messages flag when generating the outputs.
This file is the same file used in the Pro Client to suppress those
messages.
[ Test Plan ]
Compare the messages before and after installing the new version of the package, and make sure they are exactly the same in different scenarios:
- ESM status: unavailable, disabled, enabled
- LTS system: yes or no
- updates available: yes or no
Thankfully, the unit test suite in tests/test_motd.py covers all of
those scenarios functionality-wise. Manual checks on real systems may
endorse the functionality.
New tests were added to the suite making sure the flag hides the ESM
related messages when it is present.
On real systems, creating the /var/lib/ubuntu-advantage/hide-esm-in-
motd marker file and making sure to update the MOTDs should remove ESM
related messages for the same scenarios above.
The execution of the script relies on running one of a couple trigger
hooks set in the apt configuration. Running `apt update` will trigger
one of them. To make sure messages will be updated, the
/var/lib/update-notifier/updates-available stamp file can be removed
before the update. (The alternative would be running manually with
--force, but that is slightly worse for acceptance testing)
[ Where problems could occur ]
- Other software may be relying on the apt-check script to generate
human-readable messages. A mistake here could intefere with the
message generated, changing expectation on stable releases, or causing
errors. To mitigate that, the standard behavior is exactly the same if
the marker file is absent, and all existing functionality is
preserved.
- Users may make mistakes when creating the marker file. We will
mitigate that by having comprehensible documentation with a clear
explanation of what the flag does and where to put it. The worst that
can happen is that users create a useless file, and no change happens.
[ Other Info ]
As opposed to what was in the original description, the proposed
changeset does not separate esm messages from the regular updates
messages - this ensures current users and potential callers get
exactly the same result when checking their outputs after the change
lands.
As suggested in the original description, we understand that it is not
the easiest and straightforward approach create a specific file when
compared to running a command or clicking a button. However, the
messages are there for a product decision, and it is a product
decision not to have a "too easy opt-out". On the other hand, users
who want to disable this are capable of creating the file, and it will
be way easier for them than making the changes in the python script
itself - plus the configuration is kept between upgrades.
As noted in a subsequent comment, the patch fixing this bug introduces
a new help message. The translations of update-notifier are shipped
together with the package. Consulting with @enr0n, the decision about
this new entry is:
- For the Noble version, @enr0n will add this new line to the pot file, so it can be translated for the future releases.
- For the SRUs, we will let it be as is. The main two reasons are:
1. there is low value in translating this string to the couple
languages we know, and new translations would require a new SRU in the
future - except in special cases, there are no translations done in
SRUs anyway
2. there is low exposure of the string - it is not in the consumable
output of the command, but rather help text for a command that is
niched enough - as also noted, we don't expect all users to be
applying this.
[ Original Description ]
See https://github.com/canonical/ubuntu-pro-client/issues/2458 for the
origin of the conversation.
We don't think it needs to be _easy_, but it should probably be less
burdensome to disable ESM update notifications in MOTD without
disabling all update notifications in MOTD.
One idea to accomplish this is to separate the /etc/update-motd.d/
files into two. One would print the normal update message, and the
other would print the ESM message. Then, if an admin knows what
they're doing and is willing to accept the risk, they can remove or
edit the ESM update-notifier motd conffile. This is similar to how you
can remove the APT ESM messages by removing/editing
/etc/apt/apt.conf.d/20apt-esm-hook.conf if you know what you're doing.
This would also require some changes to how the messages are created,
since currently it is all in apt_check.py and printed into a single
message file. They'll need to be separated somehow.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2015420/+subscriptions
More information about the foundations-bugs
mailing list