Bug in /etc/update-motd.d/50-landscape-sysinfo script - incorrect variable used for load threshold calculation

Bug #2066983 reported by Markus
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Committed
Undecided
Unassigned
Jammy
Fix Committed
Undecided
Unassigned
Noble
Fix Committed
Undecided
Unassigned

Bug Description

[ Impact ]

 * The CPU load is incorrectly calculated, and users won't get system info in
the message-of-the-day (motd).

 * The `cores` variable was misnamed; it should be `CORES` since bash variables are case-sensitive

* Affects landscape-client on noble, mantic, jammy, and focal.

[ Test Plan ]

Steps to Reproduce:

    1. Open the /etc/update-motd.d/50-landscape-sysinfo script.
    2. Notice the line where THRESHOLD is set: THRESHOLD="${cores:-1}.0".
    3. The correct variable should be CORES instead of cores.

To trigger MOTD and view incorrect calculation:

sudo run-parts /etc/update-motd.d/
Notice message: " System information disabled due to load higher than 1.0" even on systems with multiple cores.

[ Where problems could occur ]

 * This fix will necessarily run the system process info on more systems during MOTD. If the CPU load threshold was poorly chosen, then overly-loaded systems might be slow during MOTD while landscape-sysinfo runs

Related branches

Revision history for this message
Spencer Runde (spencerrunde) wrote :

Hi Markus,

Thank you for your bug report. We have an SRU in progress for this, and it should land shortly.

Changed in landscape-client (Ubuntu):
status: New → In Progress
assignee: nobody → Spencer Runde (spencerrunde)
Revision history for this message
Spencer Runde (spencerrunde) wrote :

Original bug report:

===

There is a bug in the /etc/update-motd.d/50-landscape-sysinfo (Symlink to /usr/share/landscape/landscape-sysinfo.wrapper) script in Ubuntu. The script incorrectly sets the load threshold due to a typo, causing the system information to be disabled unnecessarily when the system load is actually within acceptable limits.

Steps to Reproduce:

    1. Open the /etc/update-motd.d/50-landscape-sysinfo script.
    2. Notice the line where THRESHOLD is set: THRESHOLD="${cores:-1}.0".
    3. The correct variable should be CORES instead of cores.

Expected Behavior:
The threshold should be calculated based on the number of CPU cores, e.g., THRESHOLD="${CORES:-1}.0", and system information should be displayed correctly when the load is below this threshold.

Actual Behavior:
The threshold is incorrectly set to 1.0 due to the typo, causing system information to be disabled unnecessarily.

Version Information:

    Ubuntu 24.04 LTS: landscape-common 24.02-0ubuntu5
    Ubuntu 22.04.4 LTS: landscape-common 23.02-0ubuntu1~22.04.2

description: updated
description: updated
Revision history for this message
Simon Chopin (schopin) wrote :

Hi!

Whats the status on the Oracular fix? The MP has the 'Superseded' status but I don't see anything regarding this issue in the changelog.

Revision history for this message
Spencer Runde (spencerrunde) wrote :

Hi Simon,

It doesn't look like the relevant change is present in ubuntu/devel: https://git.launchpad.net/ubuntu/+source/landscape-client/tree/debian/landscape-sysinfo.wrapper

I'm not sure why that MP got marked as 'superseded'. We will want this fix in Oracular as well.

Revision history for this message
Dan Bungert (dbungert) wrote :

Hi Spencer, thanks for SRUing this fix.

I have elected to upload to f/j/m/n/o series with the following corrections:
* ubuntu/devel targetted branch needed series updated for oracular, and a
  simple merge
* all the rest needed version number corrections - I suggest having a look at
  https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging
  which outlines the version number scheme and the reasons. In the case of
  your mantic/noble proposals, those uploads would have been rejected because
  landscape-client version 23.08-0ubuntu2 and 24.02-0ubuntu6 have been uploaded
  previously. The focal / jammy ones had plausible version numbers but I have
  updated them to more closely match what's suggested on the wiki.
* the format of debian/changelog wants a certain date stamp format (month and
  day were flipped), consider using `dch -i` to add the entry, or `date -R` can
  also help. `dch` will also help with the version number increment.

Changed in landscape-client (Ubuntu):
status: In Progress → Fix Committed
assignee: Spencer Runde (spencerrunde) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 24.02-0ubuntu9

---------------
landscape-client (24.02-0ubuntu9) oracular; urgency=medium

  * d/landscape-sysinfo.wrapper: fix 'cores' variable to CORES in message-
    of-the-day load threshold calculation (LP: #2066983)

 -- Spencer Runde <email address hidden> Tue, 28 May 2024 14:19:00 -0500

Changed in landscape-client (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Markus, or anyone else affected,

Accepted landscape-client into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/24.02-0ubuntu5.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, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. 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 landscape-client (Ubuntu Noble):
status: New → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Markus, or anyone else affected,

Accepted landscape-client into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/23.02-0ubuntu1~22.04.3 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, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 landscape-client (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed-jammy
Changed in landscape-client (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Markus, or anyone else affected,

Accepted landscape-client into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/23.02-0ubuntu1~20.04.3 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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.

Revision history for this message
Markus (the-markus) wrote :

Hi Timo,

thank you very much and also thank you Spencer for fixing the bug!

I have tested the proposed package on Ubuntu Noble, Jammy & Focal using the `stress` tool to simulate high load and can confirm that the bug is fixed.

tags: added: verification-done verification-done-focal verification-done-jammy verification-done-noble
removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-noble
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.