summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarracuda Team2013-02-10 13:58:28 (GMT)
committer Barracuda Team2013-02-10 13:58:28 (GMT)
commit92a6c9f422af38713dd147e8cc2d37ec12fbbd04 (patch)
tree398064e0919283ebcb71a9b5df143ccdccaa8af2
parentb5e033f207eef4699a07c715a30afde0c2703fc9 (diff)
Check if nproc is present and fall back to /proc/cpuinfo otherwise.
-rwxr-xr-xBARRACUDA.sh.txt7
-rwxr-xr-xaegir/tools/BOND.sh.txt7
2 files changed, 12 insertions, 2 deletions
diff --git a/BARRACUDA.sh.txt b/BARRACUDA.sh.txt
index 004163c..8b743e2 100755
--- a/BARRACUDA.sh.txt
+++ b/BARRACUDA.sh.txt
@@ -1805,7 +1805,12 @@ tune_memory_limits () {
if [[ "$_AWS_TEST_A" =~ "cloudimg" ]] || [[ "$_AWS_TEST_B" =~ "cloudconfig" ]] ; then
_VMFAMILY="AWS"
fi
- _CPU_IS=`nproc`
+ _NPROC_TEST=$(which nproc)
+ if [ -z "$_NPROC_TEST" ] ; then
+ _CPU_IS=$(grep -c processor /proc/cpuinfo)
+ else
+ _CPU_IS=`nproc`
+ fi
let "_CPU_MX = (($_CPU_IS * 2))"
if [ "$_CPU_MX" -lt "4" ] ; then
_CPU_MX=4
diff --git a/aegir/tools/BOND.sh.txt b/aegir/tools/BOND.sh.txt
index 8b11afd..499333c 100755
--- a/aegir/tools/BOND.sh.txt
+++ b/aegir/tools/BOND.sh.txt
@@ -626,7 +626,12 @@ tune_memory_limits () {
if [[ "$_AWS_TEST_A" =~ "cloudimg" ]] || [[ "$_AWS_TEST_B" =~ "cloudconfig" ]] ; then
_VMFAMILY="AWS"
fi
- _CPU_IS=`nproc`
+ _NPROC_TEST=$(which nproc)
+ if [ -z "$_NPROC_TEST" ] ; then
+ _CPU_IS=$(grep -c processor /proc/cpuinfo)
+ else
+ _CPU_IS=`nproc`
+ fi
let "_CPU_MX = (($_CPU_IS * 2))"
if [ "$_CPU_MX" -lt "4" ] ; then
_CPU_MX=4