Skip to content

Commit

Permalink
Remove checking for /proc existence (#17846)
Browse files Browse the repository at this point in the history
  • Loading branch information
avkarenow authored Aug 11, 2021
1 parent 1156eb9 commit 99136cb
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions core/CliMulti/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,6 @@ public static function isSupportedWithReason()
$reasons[] = 'awk is not available or did not run as we would expect it to';
}

if (!self::isProcFSMounted() && !SettingsServer::isMac()) {
$reasons[] = 'procfs is not mounted';
}

return $reasons;
}

Expand Down Expand Up @@ -287,21 +283,6 @@ private static function returnsSuccessCode($command)
return 0 == (int) $returnCode;
}

/**
* ps -e requires /proc
* @return bool
*/
private static function isProcFSMounted()
{
if (is_resource(@fopen('/proc', 'r'))) {
return true;
}
// Testing if /proc is a resource with @fopen fails on systems with open_basedir set.
// by using stat we not only test the existence of /proc but also confirm it's a 'proc' filesystem
$type = @shell_exec('stat -f -c "%T" /proc 2>/dev/null');
return strpos($type, 'proc') === 0;
}

public static function getListOfRunningProcesses()
{
$processes = @shell_exec(self::PS_COMMAND . ' 2>/dev/null');
Expand Down

0 comments on commit 99136cb

Please sign in to comment.