Commit ec8fd46f authored by omega8cc's avatar omega8cc

Add support for file generated from /proc/cpuinfo on system with no access to /proc #unforkboa

parent cbc95d83
......@@ -395,7 +395,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