First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 80778
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Science Related Packages <sci@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Andy Dalton <andy.dalton@gmail.com>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 80778 depends on: Show dependency tree
Show dependency graph
Bug 80778 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-02-04 14:07 0000
The /etc/init.d/foldingathome startup scripts attempts to identify a CPU count
automatically if the CPU variable is set to 0 in /etc/conf.d/foldingathome. 
The code that does that is the following:

    if [ -z "${CPU}" ] || [ "${CPU}" == "0" ]; then
        if [ -r /proc/cpuinfo ]; then
            CPU=`grep processor </proc/cpuinfo | wc -l`
        else
            CPU=1
        fi
    fi

The problem is, however, the word 'processor' can appear in different places. 
Consider the following output I get by running the command manually:

# grep processor </proc/cpuinfo
processor       : 0
model name      : AMD Athlon(tm) processor

Here, I only have a single CPU, but the script determines I have two.  I
suggest revising the script as follows:

replace
    CPU=`grep processor </proc/cpuinfo | wc -l`
with
    CPU=`grep "^processor.*:" /proc/cpuinfo | wc -l`

This way, the pattern matched is restricted to lines starting with the word
processor, followed by some number of characters, followed by a colon.

Thanks,

Andy Dalton

------- Comment #1 From Brandon Low (RETIRED) 2005-02-05 16:54:48 0000 -------
Thanks, making -r3 with this change.

First Last Prev Next    No search results available      Search page      Enter new bug