"""
=== modified file 'debian/landscape-sysinfo.wrapper' (properties changed: -x to +x)
--- debian/landscape-sysinfo.wrapper 2010-07-23 08:28:59 +0000
+++ debian/landscape-sysinfo.wrapper 2011-01-12 22:18:56 +0000
@@ -1,5 +1,7 @@
#!/bin/sh
-if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < 1.0" | bc) -eq 1 ]; then
+cores=$(grep -c ^processor /proc/cpuinfo 2>/dev/null)
+threshold="${cores:-1}.0"
+if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < $cores" | bc) -eq 1 ]; then
echo
echo -n " System information as of "
/bin/date
@@ -7,5 +9,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 $threshold"
fi
"""
It just uses the number of cores, which is a good start. I don't want to get too fancy here, as doing heavy things at login time was what prompted the original bug in the first place.
Hey guys, what about this then:
""" landscape- sysinfo. wrapper' (properties changed: -x to +x) landscape- sysinfo. wrapper 2010-07-23 08:28:59 +0000 landscape- sysinfo. wrapper 2011-01-12 22:18:56 +0000 "${cores: -1}.0" bin/landscape- sysinfo
=== modified file 'debian/
--- debian/
+++ debian/
@@ -1,5 +1,7 @@
#!/bin/sh
-if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < 1.0" | bc) -eq 1 ]; then
+cores=$(grep -c ^processor /proc/cpuinfo 2>/dev/null)
+threshold=
+if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < $cores" | bc) -eq 1 ]; then
echo
echo -n " System information as of "
/bin/date
@@ -7,5 +9,5 @@
/usr/
else
echo
- echo " System information disabled due to load higher than 1"
+ echo " System information disabled due to load higher than $threshold"
fi
"""
It just uses the number of cores, which is a good start. I don't want to get too fancy here, as doing heavy things at login time was what prompted the original bug in the first place.