On Tue, Apr 13, Stephan Kulow wrote:
Grepping for ^processor in /proc/cpuinfo produces a zero result on sparc64, so don't do it. Use sysfs instead.
Signed-off-by: Jan Engelhardt
--- dist/obsworker | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dist/obsworker b/dist/obsworker index d7a77c2..295f19c 100755 --- a/dist/obsworker +++ b/dist/obsworker @@ -151,7 +151,7 @@ case "$1" in NUM="$OBS_WORKER_INSTANCES" else # start one build backend per CPU - NUM=`grep -i ^processor /proc/cpuinfo | wc -l` + NUM=$(ls /sys/devices/system/cpu/cpu* | wc -l) fi
That sounds wrong. This expression gives 10 on my single core machine. And even with -d added to the ls, it still shows cpuidle there
Strange, that works on all my machines, at least when exluding that idle cpu. cpu=( /sys/devices/system/cpu/cpu[0-9]* ) && echo ${#cpu[@]} -- With best regards, Carsten Hoeger