Don't run /usr/lib/update-notifier/update-motd-hwe-eol in containers

Bug #1855290 reported by Balint Reczey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Information of HWE kernels are shown in containers despite this information is useless most of the time since containers use the host systems' kernels.
 * The check for HWE kernels is noticably slow OTOH, taking around 0.2s on my intel i5 laptop.

[Test Case]

 * Run the script in a container to see it being shortcut:
   $ bash -x /usr/lib/update-notifier/update-motd-hwe-eol
   + '[' '' = --force ']'
   + type systemd-detect-virt
   + systemd-detect-virt -q -c
   + exit
 * Run the script in a VM of without virtualization to see it still taking long time to execute:

    $ time /usr/lib/update-notifier/update-motd-hwe-eol

    real 0m0.241s
    user 0m0.170s
    sys 0m0.073s

[Regression Potential]

 * The fix is very simple there is no expected regression.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.27

---------------
update-notifier (3.192.27) focal; urgency=medium

  * Notify user about stale updates information in motd (LP: #1842159)
  * Make /var/lib/update-notifier/updates-available world-readable
    (LP: #1844704)
  * data/update-motd-hwe-eol: Run as a regular user without printing errors
    (LP: #185527)
  * data/update-motd-hwe-eol: Shortcut script when running in a container.
    There is no point in checking the HWE stack in a container since upgrading
    it would not affect the host system. (LP: #1855290)
  * data/update-motd-fsck-at-reboot: Shortcut script when running it as
    a regular user (LP: #185527)

 -- Balint Reczey <email address hidden> Thu, 05 Dec 2019 15:02:52 +0100

Changed in update-notifier (Ubuntu):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted update-notifier into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.26.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in update-notifier (Ubuntu Eoan):
status: New → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Balint Reczey (rbalint) wrote :

root@ee-motd-verify:~# dpkg -l update-notifier-common | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================-============-============-=======================================================
ii update-notifier-common 3.192.26.1 all Files shared between update-notifier and other packages
root@ee-motd-verify:~# ls -alh /var/lib/update-notifier/updates-available
-rw-r--r-- 1 root root 143 Dec 16 14:13 /var/lib/update-notifier/updates-available
root@ee-motd-verify:~# bash -x /usr/lib/update-notifier/update-motd-hwe-eol
+ '[' '' = --force ']'
+ type systemd-detect-virt
+ systemd-detect-virt -q -c
+ exit
root@ee-motd-verify:~# systemd-detect-virt
lxc

-------

ubuntu@ee1:~$ sudo apt install update-notifier-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  update-notifier-common
1 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
Need to get 162 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu eoan-proposed/main amd64 update-notifier-common all 3.192.26.1 [162 kB]
Fetched 162 kB in 0s (516 kB/s)

(Reading database ... 61893 files and directories currently installed.)
Preparing to unpack .../update-notifier-common_3.192.26.1_all.deb ...
Unpacking update-notifier-common (3.192.26.1) over (3.192.26) ...
Setting up update-notifier-common (3.192.26.1) ...
Installing new version of config file /etc/update-motd.d/90-updates-available ...
ubuntu@ee1:~$ time /usr/lib/update-notifier/update-motd-hwe-eol

real 0m0.205s
user 0m0.161s
sys 0m0.040s
ubuntu@ee1:~$ systemd-detect-virt
kvm

tags: added: verification-done verification-done-eoan
removed: verification-needed verification-needed-eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.26.1

---------------
update-notifier (3.192.26.1) eoan; urgency=medium

  * Notify user about stale updates information in motd (LP: #1842159)
  * Make /var/lib/update-notifier/updates-available world-readable
    (LP: #1844704)
  * data/update-motd-hwe-eol: Run as a regular user without printing errors
    (LP: #1855271)
  * data/update-motd-hwe-eol: Shortcut script when running in a container.
    There is no point in checking the HWE stack in a container since upgrading
    it would not affect the host system. (LP: #1855290)
  * data/update-motd-fsck-at-reboot: Shortcut script when running it as
    a regular user (LP: #1855271)

 -- Balint Reczey <email address hidden> Thu, 05 Dec 2019 15:02:52 +0100

Changed in update-notifier (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for update-notifier has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.