update-notifier does not handle ESM Apps in the apt-check script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
update-notifier (Ubuntu) |
Fix Released
|
High
|
Chad Smith | ||
Xenial |
Fix Released
|
High
|
Lucas Albuquerque Medeiros de Moura | ||
Bionic |
Fix Released
|
High
|
Lucas Albuquerque Medeiros de Moura | ||
Focal |
Fix Released
|
High
|
Lucas Albuquerque Medeiros de Moura | ||
Groovy |
Won't Fix
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
High
|
Chad Smith | ||
Impish |
Fix Released
|
High
|
Chad Smith |
Bug Description
[Impact]
When ESM Apps goes into production we want to be able to advertise it to our users through MOTD.
Currently, update-notifier apt-check does not take into consideration the exclusive packages of ESM Apps, which is a problem.
[Test case]
To reproduce the issue, you can:
1. Launch a xenial vm
2. Install the latest version of uaclient from the stable ppa:
https:/
3. Change the following line on `/etc/ubuntu-
contract_url: 'https:/
To:
contract_url: 'https:/
4. Attach a staging token to uaclient thorough:
ua attach YOUR_STAGING_TOKEN
5. Run /usr/lib/
6. Verify that no mention to ESM Apps is made and that update-notifier puts all of the ESM packages in the same bucket
To verify that the error is fixed:
1.Perform all the stages above until step 4
2 Install the new update-notifier from this ppa:
https:/
3. Verify now that ESM Apps is reflected in the message
[Where problems could occur]
The changes in this package should only be seen when MOTD is getting a new message. If that script fails for some reason, it seems that MOTD will only not present the message, which is doesn't seem to be a system critical issue.
[Discussion]
With ESM Apps going to production soon, we have decided to update the messages delivered by update-notifier apt-check to address the package count of ESM Apps and the possibility of installing more upgrades if the user has ESM Apps disabled.
We are also updating other parts of the messaging as well. First, we only display ESM Infra status
on ESM distros. However, we will keep showing the ESM Infra package count on all of them.
For ESM Apps, we are only performing the alerts (For example, that you might have x packages updates if ESM Apps is installed) if the user is on a LTS distro.
Finally, we are also addressing this bug here:
https:/
Where we were incorrectly counting ESM packages even if the user did not have access to those services.
== Changelog ==
+ data/apt-check
- Make distinction of ESM Apps and ESM Infra when doing package count
- Only count ESM packages if the user has access to the service (LP #1883315)
- Only display ESM Infra alerts if the distro is ESM
Related branches
- git-ubuntu import: Pending requested
-
Diff: 29251 lines (+12561/-0) (has conflicts)173 files modified.bzr-builddeb/default.conf (+5/-0)
.bzrignore (+31/-0)
autogen.sh (+17/-0)
config.h.in (+3/-0)
configure.ac (+11/-0)
data/Makefile.am (+11/-0)
data/apt_check.py (+46/-0)
data/backend_helper.py (+6/-0)
data/com.ubuntu.update-notifier.gschema.xml.in (+4/-0)
data/notify-reboot-required (+3/-0)
data/package-data-downloader (+6/-0)
data/update-motd-fsck-at-reboot (+7/-0)
data/update-motd-hwe-eol (+14/-0)
data/update-motd-updates-available (+3/-0)
debian/90-updates-available (+3/-0)
debian/95-hwe-eol (+3/-0)
debian/changelog (+128/-0)
debian/compat (+4/-0)
debian/control (+28/-0)
debian/rules (+7/-0)
debian/systemd/unicast-local-avahi.override (+1/-0)
debian/systemd/unicast-local-avahi.path (+6/-0)
debian/systemd/unicast-local-avahi.service (+6/-0)
debian/systemd/update-notifier-crash.path (+3/-0)
debian/systemd/update-notifier-crash.service (+6/-0)
debian/tests/control (+4/-0)
debian/unicast-local-avahi.conf (+14/-0)
debian/update-notifier-common.cron.daily (+8/-0)
debian/update-notifier-common.cron.weekly (+15/-0)
debian/update-notifier-common.install (+6/-0)
debian/update-notifier-common.postinst (+7/-0)
debian/update-notifier-common.postrm (+8/-0)
debian/update-notifier-common.preinst (+8/-0)
debian/update-notifier-common.triggers (+4/-0)
debian/update-notifier-crash (+3/-0)
debian/update-notifier.install (+21/-0)
debian/update-notifier.links (+4/-0)
pixmaps/scalable/livepatch-on.svg (+1/-0)
pixmaps/scalable/livepatch-warning.svg (+1/-0)
po/POTFILES.in (+10/-0)
po/ace.po (+93/-0)
po/af.po (+103/-0)
po/am.po (+97/-0)
po/an.po (+100/-0)
po/ar.po (+106/-0)
po/ast.po (+102/-0)
po/az.po (+96/-0)
po/be.po (+103/-0)
po/bem.po (+93/-0)
po/bg.po (+102/-0)
po/bn.po (+102/-0)
po/bo.po (+93/-0)
po/br.po (+102/-0)
po/bs.po (+103/-0)
po/ca.po (+103/-0)
po/ca@valencia.po (+103/-0)
po/ckb.po (+96/-0)
po/crh.po (+103/-0)
po/cs.po (+103/-0)
po/csb.po (+104/-0)
po/cv.po (+93/-0)
po/cy.po (+105/-0)
po/da.po (+103/-0)
po/de.po (+103/-0)
po/de_DE.po (+93/-0)
po/dv.po (+93/-0)
po/el.po (+102/-0)
po/en.po (+93/-0)
po/en_AU.po (+103/-0)
po/en_CA.po (+103/-0)
po/en_GB.po (+103/-0)
po/eo.po (+102/-0)
po/es.po (+102/-0)
po/et.po (+102/-0)
po/eu.po (+103/-0)
po/fa.po (+101/-0)
po/fa_AF.po (+93/-0)
po/fi.po (+103/-0)
po/fil.po (+97/-0)
po/fo.po (+102/-0)
po/fr.po (+103/-0)
po/fr_CA.po (+93/-0)
po/fur.po (+98/-0)
po/fy.po (+102/-0)
po/ga.po (+98/-0)
po/gd.po (+105/-0)
po/gl.po (+103/-0)
po/gu.po (+97/-0)
po/he.po (+102/-0)
po/hi.po (+102/-0)
po/hr.po (+104/-0)
po/hu.po (+103/-0)
po/hy.po (+93/-0)
po/id.po (+102/-0)
po/is.po (+102/-0)
po/it.po (+103/-0)
po/ja.po (+101/-0)
po/jv.po (+93/-0)
po/ka.po (+101/-0)
po/kk.po (+101/-0)
po/km.po (+101/-0)
po/kn.po (+93/-0)
po/ko.po (+101/-0)
po/ku.po (+100/-0)
po/ky.po (+93/-0)
po/lo.po (+93/-0)
po/lt.po (+103/-0)
po/lv.po (+103/-0)
po/mhr.po (+93/-0)
po/mi.po (+93/-0)
po/mk.po (+99/-0)
po/ml.po (+97/-0)
po/mn.po (+102/-0)
po/mr.po (+97/-0)
po/ms.po (+103/-0)
po/mt.po (+93/-0)
po/my.po (+96/-0)
po/nb.po (+103/-0)
po/nds.po (+102/-0)
po/ne.po (+97/-0)
po/nl.po (+103/-0)
po/nn.po (+103/-0)
po/oc.po (+103/-0)
po/pa.po (+100/-0)
po/pl.po (+104/-0)
po/ps.po (+93/-0)
po/pt.po (+103/-0)
po/pt_BR.po (+103/-0)
po/pt_PT.po (+93/-0)
po/qu.po (+93/-0)
po/ro.po (+104/-0)
po/ru.po (+103/-0)
po/sco.po (+93/-0)
po/sd.po (+93/-0)
po/se.po (+93/-0)
po/shn.po (+93/-0)
po/si.po (+100/-0)
po/sk.po (+103/-0)
po/sl.po (+105/-0)
po/sq.po (+103/-0)
po/sr.po (+103/-0)
po/st.po (+93/-0)
po/sv.po (+103/-0)
po/ta.po (+97/-0)
po/te.po (+102/-0)
po/tg.po (+103/-0)
po/th.po (+101/-0)
po/tl.po (+99/-0)
po/tr.po (+102/-0)
po/ug.po (+101/-0)
po/uk.po (+103/-0)
po/ur.po (+93/-0)
po/uz.po (+99/-0)
po/vi.po (+101/-0)
po/xh.po (+93/-0)
po/zh_CN.po (+101/-0)
po/zh_HK.po (+101/-0)
po/zh_TW.po (+101/-0)
src/Makefile.am (+23/-0)
src/avahi.c (+47/-0)
src/avahi.h (+3/-0)
src/crash.c (+13/-0)
src/hooks.c (+6/-0)
src/livepatch-tray.c (+16/-0)
src/livepatch-utils.c (+4/-0)
src/livepatch-utils.h (+9/-0)
src/system-crash.c (+8/-0)
src/update-notifier.c (+43/-0)
src/update-notifier.h (+16/-0)
src/update.c (+8/-0)
tests/pyflakes.exclude (+4/-0)
tests/test_motd.py (+88/-0)
tests/test_pep8.py (+39/-0)
- Bryce Harrington (community): Approve
-
Diff: 885 lines (+521/-143)4 files modifieddata/apt_check.py (+186/-83)
debian/changelog (+17/-0)
debian/control (+2/-0)
tests/test_motd.py (+316/-60)
- Bryce Harrington (community): Approve
- Lucas Albuquerque Medeiros de Moura: Pending requested
- Brian Murray: Pending requested
-
Diff: 885 lines (+521/-143)4 files modifieddata/apt_check.py (+186/-83)
debian/changelog (+17/-0)
debian/control (+2/-0)
tests/test_motd.py (+316/-60)
- Bryce Harrington (community): Approve
-
Diff: 910 lines (+535/-147)5 files modifieddata/apt_check.py (+195/-83)
data/backend_helper.py (+1/-0)
debian/changelog (+17/-0)
debian/control (+2/-0)
tests/test_motd.py (+320/-64)
- Bryce Harrington (community): Approve
-
Diff: 897 lines (+533/-146)4 files modifieddata/apt_check.py (+195/-81)
debian/changelog (+15/-0)
debian/control (+2/-0)
tests/test_motd.py (+321/-65)
- Bryce Harrington (community): Approve
-
Diff: 903 lines (+533/-149)4 files modifieddata/apt_check.py (+195/-82)
debian/changelog (+15/-0)
debian/control (+2/-0)
tests/test_motd.py (+321/-67)
Changed in update-notifier (Ubuntu Xenial): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in update-notifier (Ubuntu Xenial): | |
assignee: | nobody → Lucas Albuquerque Medeiros de Moura (lamoura) |
Changed in update-notifier (Ubuntu Xenial): | |
status: | Triaged → In Progress |
Changed in update-notifier (Ubuntu Bionic): | |
assignee: | nobody → Lucas Albuquerque Medeiros de Moura (lamoura) |
Changed in update-notifier (Ubuntu Focal): | |
assignee: | nobody → Lucas Albuquerque Medeiros de Moura (lamoura) |
Changed in update-notifier (Ubuntu Hirsute): | |
assignee: | nobody → Chad Smith (chad.smith) |
Changed in update-notifier (Ubuntu Impish): | |
assignee: | nobody → Chad Smith (chad.smith) |
Changed in update-notifier (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in update-notifier (Ubuntu Focal): | |
status: | New → In Progress |
Changed in update-notifier (Ubuntu Hirsute): | |
status: | New → In Progress |
Changed in update-notifier (Ubuntu Impish): | |
status: | New → In Progress |
Changed in update-notifier (Ubuntu Bionic): | |
importance: | Undecided → High |
Changed in update-notifier (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in update-notifier (Ubuntu Hirsute): | |
importance: | Undecided → High |
Changed in update-notifier (Ubuntu Impish): | |
importance: | Undecided → High |
For this SRU bug I have created the following test script:
------- ------- ------- ------- -------
#!/bin/sh
set -x
series=hirsute
name=$series-dev
function update- notifier- ua-not- installed () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# x packages can be updated.
# x of these updates are security updates.
echo "------
echo "$series: ua not installed"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-not- attached- esm () { /ubuntu. com/security/ esm or run: sudo ua status ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# x updates can be installed immediately.
# x of these updates are security updates.
#
# Enable UA Apps: ESM to receive x additional security updates.
# See https:/
echo "------
echo "$series esm: ua not attached"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-not- attached () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# UA Infra: Extended Security Maintenance (ESM) is not enabled.
#
# x updates can be installed immediately.
# x of these updates are security updates.
echo "------
echo "$series non-esm: ua not attached"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-attached- esm () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# x updates can be installed immediately.
# x of these updates are fixed through UA Apps: ESM.
# x of these updates are security updates.
# To see these additional updates run: apt list --upgradable
echo "------
echo "$series esm: ua attached"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-attached () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# x updates can be installed immediately.
# x of these updates are fixed through UA Apps: ESM.
# x of these updates are security updates.
# To see these additional updates run: apt list --upgradable
echo "------
echo "$series non-esm: ua attached"
lxc exec $name -- /usr/lib/
echo "------
}
function turn-distro- into-esm- mode() { currently_ supported/ True #comment/' /usr/lib/ update- notifier/ apt-check
# guarantee that xenial distro is on ESM mode
lxc exec $name -- sed -i 's/is_esm_supported and is_not_
}
function turn-distro- into-non- esm-mode( ) { update- notifier/ apt-check
# guarantee that xenial distro is on ESM mode
lxc exec $name -- sed -i 's/True #comment/False/' /usr/lib/
}
function setup-update- notifier( ) { update- notifier. ..
lxc exec $name -- add-apt-repository ppa:lamoura/