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

Bug #2066983 reported by Markus
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
In Progress
Undecided
Spencer Runde

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
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.