Commit ee77a8a3 authored by omega8cc's avatar omega8cc

Sync with 6.x workaround for systems with access to /data/all/cpuinfo instead of /proc/cpuinfo

parent 715c3a16
......@@ -404,7 +404,15 @@ function _provision_default_web_group() {
*/
function provision_count_cpus() {
$ncpus = FALSE;
if (file_exists("/proc/cpuinfo")) {
if (is_readable("/data/all/cpuinfo")) {
# this should work on BOA with a /data/all/cpuinfo generated daily
$cpuinfo = file_get_contents("/data/all/cpuinfo");
$cpuinfo = str_replace('\n', '', $cpuinfo);
if ($cpuinfo !== FALSE && is_numeric($cpuinfo)) {
$ncpus = $cpuinfo;
}
}
elseif (is_readable("/proc/cpuinfo")) {
# this should work on Linux with a /proc filesystem
$cpuinfo = file_get_contents("/proc/cpuinfo");
if ($cpuinfo !== FALSE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment