MOTD too conservative about showing sysinfo

Bug #666169 reported by Dominic Dunlop
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: landscape-client

On multi-core machines, the policy of not showing system information on login if load is 1.0 or greater, as implemented by /usr/share/landscape/landscape-sysinfo.wrapper, is too conservative. The following patch suppresses the information only if the load is greater than the number of cores of the host:

--- landscape-sysinfo.wrapper-before 2010-10-25 10:05:26.000000000 +0200
+++ landscape-sysinfo.wrapper 2010-10-25 10:06:41.000000000 +0200
@@ -1,5 +1,6 @@
 #!/bin/sh
-if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < 1.0" | bc) -eq 1 ]; then
+CORES=$(grep -c '^core id\b' /proc/cpuinfo)
+if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < $CORES.0" | bc) -eq 1 ]; then
     echo
     echo -n " System information as of "
     /bin/date
@@ -7,5 +8,5 @@
     /usr/bin/landscape-sysinfo
 else
     echo
- echo " System information disabled due to load higher than 1"
+ echo " System information disabled due to load higher than $CORES"
 fi

ProblemType: Bug
Architecture: i386
Date: Mon Oct 25 10:07:19 2010
DistroRelease: Ubuntu 9.10
Package: landscape-common 1.5.5.1-0ubuntu0.9.10.0 [modified: usr/share/landscape/landscape-sysinfo.wrapper]
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-22.67-generic-pae
SourcePackage: landscape-client
Uname: Linux 2.6.31-22-generic-pae i686

Revision history for this message
Dominic Dunlop (dominic-dunlop) wrote :
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.