Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
ec8fd46f
Commit
ec8fd46f
authored
Sep 08, 2014
by
Grazyna Jaworska
Browse files
Add support for file generated from /proc/cpuinfo on system with no access to /proc #unforkboa
parent
cbc95d83
Changes
1
Hide whitespace changes
Inline
Side-by-side
provision.drush.inc
View file @
ec8fd46f
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment